IOS linking error OpenCV 2.4.7
Hi I am trying to link an IOS OpenCV 2.4.7 Face detection application in Xcode 5.1 and I am getting the following error:
ld: warning: ignoring file /Users/marcio/Downloads/opencv-2.4.7/ios/opencv2.framework/opencv2, missing required architecture x86_64 in file /Users/marcio/Downloads/opencv-2.4.7/ios/opencv2.framework/opencv2 (3 slices) Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_CvVideoCamera", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have download openCv from the OpenCV site and followed the directions to compile and install the framework in Xcode. I have checked the ld command and it is trying to use the correct iPhone simulator files.
Below is the output of the ld command:
Ld /Users/marcio/Library/Developer/Xcode/DerivedData/Net_Open_ICAO_Camera-evphtbnpbyfbudcdodtnitzvgchm/Build/Intermediates/Net\ Open\ ICAO\ Camera.build/Debug-iphonesimulator/Net\ Open\ ICAO\ Camera.build/Objects-normal/x86_64/Net\ Open\ ICAO\ Camera normal x86_64 cd "/Users/marcio/Net Open ICAO Camera" setenv IPHONEOS_DEPLOYMENT_TARGET 7.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/marcio/Library/Developer/Xcode/DerivedData/Net_Open_ICAO_Camera-evphtbnpbyfbudcdodtnitzvgchm/Build/Products/Debug-iphonesimulator -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/3rdparty/lib/Release -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/3rdparty/libjpeg/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/3rdparty/libpng/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/3rdparty/zlib/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/lib/Release -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/calib3d/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/contrib/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/core/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/features2d/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/flann/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/highgui/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/imgproc/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/legacy/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/ml/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/nonfree/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/objdetect/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/photo/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/stitching/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/video/UninstalledProducts -L/Users/marcio/Downloads/opencv-2.4.7/ios/build/iPhoneSimulator-i386/modules/videostab ...
i think its because you are building for x86_64 Architecture while OpenCV is compiled for arm