文件是专为i386的这是不被链接(x86_64的),而在Mac OSX 10.6编译OpenCV2.2为iOS 4.2的架构 [英] file was built for i386 which is not the architecture being linked (x86_64) while compiling OpenCV2.2 for iOS 4.2 on Mac OSX 10.6
问题描述
我一直在下面的<一个简单的指南href=\"http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2\">http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2 (使用旧的引导,我也是在<读href=\"http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en\">http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en) 。让编译在iOS 4.2的工作OpenCV2.2一切顺利,直到我试图建立当我运行以下命令:
I have been following the simple guide at http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2 (which uses the older guide I've also read at http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en) to get OpenCV2.2 compiled to work on iOS 4.2. Everything went smoothly until I tried to build. When I run the following:
lc:opencv_simulator leonard$ ../opencv_cmake.sh Simulator ../../OpenCV-2.2.0/
我收到以下错误:
I get the following error:
ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
这是使用(在其他设置,很明显):
This is using (among other settings, obviously):
-D CMAKE_OSX_ARCHITECTURES="i386"
我读了在OSX 10.6 i386的被看作是默认的,所以它使用系统默认的(但是这是x86_64的)。我也看了,我可以用:
I read that on OSX 10.6 i386 is seen as the default, so it uses the system default (but that is x86_64). I also read I could use:
export CFLAGS=-m32
export CPPFLAGS=-m32
但是,这也不行。
But this doesn't work either.
任何想法?
推荐答案
为建设一个特定的体系结构的GCC标志 -march
在
The gcc flag for building a specific architecture is -march
as in
gcc -march=i386 ...
这篇关于文件是专为i386的这是不被链接(x86_64的),而在Mac OSX 10.6编译OpenCV2.2为iOS 4.2的架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!