opencvFaceExample not working

/openFrameworks-b4397c1/apps/iPhoneAddonsExamples/opencvFaceExample not able to run while all other sample projects are running on xcode

Previously** I was getting only 5 normal errors** like xml haarcascade and 3 png files were missing and 1 method redefinition was there. As soon as I resolved above 5 errors by placing png and xml**. Now I am getting 42 errors.**

Please help, these are the list of build failed errors

“.objc_class_name_NSAutoreleasePool”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in opencv_highgui.a(window_cocoa.o)

literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSRunLoop”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSRunLoop in opencv_highgui.a(cap_qtkit.o)

“_QTMovieEditableAttribute”, referenced from:

_QTMovieEditableAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieEditableAttribute$non_lazy_ptr)

“_QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute”, referenced from:

_QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute$non_lazy_ptr)

“.objc_class_name_NSSlider”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSSlider in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_NSThread”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSThread in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_QTCaptureSession”, referenced from:

literal-pointer@__OBJC@__cls_refs@QTCaptureSession in opencv_highgui.a(cap_qtkit.o)

“_QTMovieLoopsAttribute”, referenced from:

_QTMovieLoopsAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieLoopsAttribute$non_lazy_ptr)

“.objc_class_name_NSMutableDictionary”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSMutableDictionary in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_NSString”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSString in opencv_highgui.a(window_cocoa.o)

literal-pointer@__OBJC@__cls_refs@NSString in opencv_highgui.a(cap_qtkit.o)

“_QTMovieDurationAttribute”, referenced from:

_QTMovieDurationAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieDurationAttribute$non_lazy_ptr)

“_QTMakeTime”, referenced from:

CvVideoWriter_QT::writeFrame(_IplImage const*) in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSWindow”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSWindow in opencv_highgui.a(window_cocoa.o)

.objc_class_name_CVWindow in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_QTCaptureDeviceInput”, referenced from:

literal-pointer@__OBJC@__cls_refs@QTCaptureDeviceInput in opencv_highgui.a(cap_qtkit.o)

“_objc_exception_try_enter”, referenced from:

-[CaptureDelegate captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:] in opencv_highgui.a(cap_qtkit.o)

-[CaptureDelegate updateImage] in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSTextField”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSTextField in opencv_highgui.a(window_cocoa.o)

“_NSAppKitVersionNumber”, referenced from:

_NSAppKitVersionNumber$non_lazy_ptr in opencv_highgui.a(window_cocoa.o)

(maybe you meant: _NSAppKitVersionNumber$non_lazy_ptr)

“_QTMovieFrameImageType”, referenced from:

_QTMovieFrameImageType$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieFrameImageType$non_lazy_ptr, _QTMovieFrameImageTypeCVPixelBufferRef$non_lazy_ptr )

“.objc_class_name_NSEvent”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSEvent in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_NSImage”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSImage in opencv_highgui.a(window_cocoa.o)

literal-pointer@__OBJC@__cls_refs@NSImage in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSApplication”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSApplication in opencv_highgui.a(window_cocoa.o)

“_QTMediaTypeVideo”, referenced from:

_QTMediaTypeVideo$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMediaTypeVideo$non_lazy_ptr)

“_objc_exception_extract”, referenced from:

-[CaptureDelegate captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:] in opencv_highgui.a(cap_qtkit.o)

-[CaptureDelegate updateImage] in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_QTMovie”, referenced from:

literal-pointer@__OBJC@__cls_refs@QTMovie in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSDictionary”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSDictionary in opencv_highgui.a(cap_qtkit.o)

“_QTMovieFrameImageTypeCVPixelBufferRef”, referenced from:

_QTMovieFrameImageTypeCVPixelBufferRef$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieFrameImageTypeCVPixelBufferRef$non_lazy_ptr)

“.objc_class_name_NSObject”, referenced from:

.objc_class_name_CaptureDelegate in opencv_highgui.a(cap_qtkit.o)

“_QTAddImageCodecType”, referenced from:

_QTAddImageCodecType$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTAddImageCodecType$non_lazy_ptr)

“.objc_class_name_QTCaptureDecompressedVideoOutput”, referenced from:

literal-pointer@__OBJC@__cls_refs@QTCaptureDecompressedVideoOutput in opencv_highgui.a(cap_qtkit.o)

“ofiPhoneVideoGrabber::ofiPhoneVideoGrabber()”, referenced from:

ofVideoGrabber::initGrabber(int, int, bool)in libofxiPhone_iphonesimulator_Debug.a(ofVideoGrabber.o)

“.objc_class_name_NSBitmapImageRep”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSBitmapImageRep in opencv_highgui.a(window_cocoa.o)

literal-pointer@__OBJC@__cls_refs@NSBitmapImageRep in opencv_highgui.a(cap_qtkit.o)

“_NSDeviceRGBColorSpace”, referenced from:

_NSDeviceRGBColorSpace$non_lazy_ptr in opencv_highgui.a(window_cocoa.o)

_NSDeviceRGBColorSpace$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _NSDeviceRGBColorSpace$non_lazy_ptr)

“.objc_class_name_NSFileManager”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSFileManager in opencv_highgui.a(cap_qtkit.o)

“_QTMovieCurrentTimeAttribute”, referenced from:

_QTMovieCurrentTimeAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieCurrentTimeAttribute$non_lazy_ptr)

“_objc_exception_try_exit”, referenced from:

-[CaptureDelegate captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:] in opencv_highgui.a(cap_qtkit.o)

-[CaptureDelegate captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:] in opencv_highgui.a(cap_qtkit.o)

-[CaptureDelegate updateImage] in opencv_highgui.a(cap_qtkit.o)

-[CaptureDelegate updateImage] in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSNumber”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSNumber in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSDate”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSDate in opencv_highgui.a(window_cocoa.o)

literal-pointer@__OBJC@__cls_refs@NSDate in opencv_highgui.a(cap_qtkit.o)

“_QTMovieNaturalSizeAttribute”, referenced from:

_QTMovieNaturalSizeAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTMovieNaturalSizeAttribute$non_lazy_ptr)

“_QTTrackTimeScaleAttribute”, referenced from:

_QTTrackTimeScaleAttribute$non_lazy_ptr in opencv_highgui.a(cap_qtkit.o)

(maybe you meant: _QTTrackTimeScaleAttribute$non_lazy_ptr)

“.objc_class_name_QTCaptureDevice”, referenced from:

literal-pointer@__OBJC@__cls_refs@QTCaptureDevice in opencv_highgui.a(cap_qtkit.o)

“.objc_class_name_NSView”, referenced from:

.objc_class_name_CVSlider in opencv_highgui.a(window_cocoa.o)

.objc_class_name_CVView in opencv_highgui.a(window_cocoa.o)

“.objc_class_name_NSScreen”, referenced from:

literal-pointer@__OBJC@__cls_refs@NSScreen in opencv_highgui.a(window_cocoa.o)

I had this same problem in XCode 4 with the latest v007 from Git, and I think I’ve got the solution. It might be a bit late for Tariq, but other’s may find this post…

I think you would have also had linker /warnings/ above these errors saying e.g.

ignoring file …/…/…/libs/FreeImage/lib/iphone/glu-iphone.a, missing required architecture i386
ignoring file …/…/…/libs/FreeImage/lib/iphone/freeimage.a, missing required architecture i386 in file

This seems to be because the iPhone simulator is an i386 target, and the projects build all architectures by default in XCode 4 even when you’re targetting an iOS device. And these libraries were compiled for arm6/7 only.

So if you switch “Build Active Architecture Only” to ‘Yes’ and/or also remove ‘iphonesimulator’ from the ‘Supported Platforms’ in your build settings, do a clean for luck and you should get past the linker errors.

I guess the long term solution though is to point the linker to i386 versions of these libraries, to enable testing in the iPhone simulator.

[UPDATE]
Hmm I just reverted these settings one by one and now it builds OK - in the original setup, so I’m obviously wrong about the above, but it did ‘cure’ it! I think the linker warnings are just because all variants of the libraries are included, so it’s ignoring the ones it doesn’t need for the architecture being built.

Pip