The file was created for i386, which is not related to architecture (x86_64) when compiling OpenCV2.2 for iOS 4.2 on Mac OSX 10.6

I followed a simple guide at http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2 (which uses an earlier guide that I also read in http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en ) to get OpenCV2.2 compiled to work with 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 used (among other settings, obviously):

-D CMAKE_OSX_ARCHITECTURES="i386"

, OSX 10.6 i386 , ( x86_64). , :

export CFLAGS=-m32
export CPPFLAGS=-m32

.

?

+5
1

gcc -march,

gcc -march=i386 ...
+4

All Articles