Domanda
Ottengo il seguente errore durante la creazione di OpenCV su OS X 10.5 (intel):
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
Durante l'esecuzione ./configure --without-python è tutto a posto. Un'altra cosa strana è che quando ho usato Python 2.4.5 o 2.5.1 tutto è andato bene, il problema si è verificato dopo il passaggio a Python Framework 2.5.2
Soluzione 3
Ok, l'ho quasi risolto
Deve essere compilato con Python da Macport o altro. Quindi ho bisogno di eseguire /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
(questa è la mia precedente versione di Python) e lì OpenCV funziona e basta.
Altri suggerimenti
Sembra un po 'strano avvertire di architetture diverse quando si cerca /Developer/SDKs/MacOSX10.4u.sdk durante il collegamento - puoi darci qualche dettaglio in più sul tuo ambiente di build (versione di XCode, GCC, Python , $ PERCORSO ecc.)
In alternativa, nessuno dei binari OpenCV disponibili funzionerà per te?
/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib è solo un link a / usr / local / lib dopo aver eliminato i file che hanno causato gli avvisi sto ricevendo:
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: ... `
E questi file sono creati da make.
gcc: i686-apple-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 (più recente)
Python 2.5.1 (r251: 54869, 18 aprile 2007, 22:08:04) - MacPython da python.org (ho provato a eseguire il downgrade e ad usarlo invece della 2.5.2, ma non funziona più ...)
which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
Non ho trovato alcun binario Python OpenCV per OS X. Ho provato a farlo mentre si imposta python2.4 o 2.5 da macports come predefinito e si compila e si installa, ma quando provo a importare c'è un errore del bus o errore fatale Python Interpreter non inizializzato (versione non corrispondente?) e si chiude.