2008-11-24 57 views
4

我碰到下面的錯誤,而在OS X 10.5(英特爾)建設的OpenCV:的OpenCV的Python的 - OS X

ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture 
ld: warning in .libs/_cv_la-error.o, file is not of required architecture 
ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture 
ld: warning in .libs/_cv_la-cvshadow.o, file is not of required architecture 
ld: warning in ../../../cv/src/.libs/libcv.dylib, file is not of required architecture 
ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libcxcore.dylib, file is not of required architecture 
Undefined symbols for architecture i386: 
"_fputs$UNIX2003", referenced from: 
    _PySwigObject_print in _cv_la-_cv.o 
    _PySwigPacked_print in _cv_la-_cv.o 
    _PySwigPacked_print in _cv_la-_cv.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 
lipo: can't open input file: /var/folders/Sr/Srq9N4R8Hr82xeFvW3o-uk+++TI/-Tmp-//cchT0WVX.out (No such file or directory) 
make[4]: *** [_cv.la] Error 1 
make[3]: *** [all-recursive] Error 1 
make[2]: *** [all-recursive] Error 1 
make[1]: *** [all-recursive] Error 1 
make: *** [all] Error 2 

雖然運行./configure --without-蟒蛇一切正常。另一個奇怪的是,當我使用的Python 2.4.5或2.5.1一切都已經建立好了,這個問題轉換到Python框架後發生2.5.2

+0

您正在使用哪種python發行版?也許它還沒有經過OpenCV的測試。你有沒有考慮過使用macports構建python和opencv? – speciousfool 2008-11-26 08:04:32

回答

0

好吧,我種的工作了

它需要從MacPorts的或任何蟒蛇進行編譯。然後我需要運行/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5(這是我以前的python版本),並且OpenCV正常。

1

這似乎有點不可思議,這是觀察時警告有關不同的架構對於/Developer/SDKs/MacOSX10.4u.sdk而鏈接 - 你能不能給我們介紹一下你的編譯環境的一些更詳細(的XCode,GCC,Python版本,$ PATH等)

或者,不會將任何的OpenCV二進制文件可用嗎?

0

/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib只是刪除文件導致的警告我收到後到/ usr/local/lib目錄 鏈接:

ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture 
ld: warning in .libs/_cv_la-error.o, file is not of required architecture 
ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture 
ld: warning in .libs/_cv_la-cvshadow.o, file is not of required architecture 
ld: warning in ../../../cv/src/.libs/libcv.dylib, file is not of required architecture 
ld: warning in /Users/Pietras/opencv/cxcore/src/.libs/libcxcore.dylib, file is not of required architecture 
Undefined symbols for architecture i386: ... ` 

這些文件是由make創建的。

GCC:爲i686-蘋果darwin9-GCC-4.0.1

$ PATH:

/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/sw/bin:/sw/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/AVRMacPack/bin:/usr/X11R6/bin 

的XCode 3(最新)

的Python 2.5.1(R251:54869,四月18 2007年,22時08分04秒) - MacPython上從python.org (試圖降級,並使用它,而不是2.5.2,但不工作了...)

which python 
/Library/Frameworks/Python.framework/Versions/Current/bin/python 

我沒有找到OS X的任何Python OpenCV二進制文件。 我試圖在從macports設置python2.4或2.5作爲默認設置的情況下進行編譯和安裝,但是當我嘗試導入時有一條總線錯誤或致命的Python錯誤解釋器未初始化(版本不匹配?) 並且它退出。