Ask Your Question
0

I can't get latest OpenCV to link with latest Xcode

asked 2014-04-14 11:44:07 -0500

Hat Trick gravatar image

updated 2014-04-14 16:46:36 -0500

Try as I might I cannot get the latest OpenCV for iOS to link. All the errors are symbols linked from cap_ios_video_camera.o

Undefined symbols for architecture armv7: "_kCVPixelBufferPixelFormatTypeKey", referenced from: -[CvVideoCamera createVideoDataOutput] in opencv2(cap_ios_video_camera.o) -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_kCVPixelBufferCGImageCompatibilityKey", referenced from: -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o) "_kCVPixelBufferCGBitmapContextCompatibilityKey", referenced from: -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o) "_CVPixelBufferGetPixelFormatType", referenced from: -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o) "_CVPixelBufferGetBaseAddress", referenced from: -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o) -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o) "_CVPixelBufferGetBytesPerRow", referenced from: -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)

I've downloaded the framework three times, searched through this forum, stack overflow, /r/opencv on reddit and question on the apple website. So far nothing has affected these errors. My project is set to link with libc++ which is included in the link binaries as a dylib. All C++ dialects are set to C++11, I have opencv2.hpp include in the prefix header, I'm using namespace cv and all the source files have an mm extension. This is the LD command line -

Ld Build/Intermediates/Spectacle.build/Debug-iphoneos/Spectacle.build/Objects-normal/armv7/Spectacle normal armv7 cd /Source/Spectacle export IPHONEOS_DEPLOYMENT_TARGET=7.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Source/Spectacle/Build/Products/Debug-iphoneos -F/Source/Spectacle/Build/Products/Debug-iphoneos -F/Source/Spectacle -filelist /Source/Spectacle/Build/Intermediates/Spectacle.build/Debug-iphoneos/Spectacle.build/Objects-normal/armv7/Spectacle.LinkFileList -dead_strip -stdlib=libc++ -fobjc-link-runtime -miphoneos-version-min=7.0 -lc++ -framework opencv2 -framework OpenGLES -framework CoreGraphics -framework CoreImage -framework CoreMedia -framework CoreLocation -framework AssetsLibrary -framework QuartzCore -framework UIKit -framework AVFoundation -framework Foundation -Xlinker -dependency_info -Xlinker /Source/Spectacle/Build/Intermediates/Spectacle.build/Debug-iphoneos/Spectacle.build/Objects-normal/armv7/Spectacle_dependency_info.dat -o /Source/Spectacle/Build/Intermediates/Spectacle.build/Debug-iphoneos/Spectacle.build/Objects-normal/armv7/Spectacle

I've download the source but I didn't realise that cmake was a third party program that I had to download. I tried greping the source and found those missing symbols so I ran the automated build but it fails with errors. So now I'm trying to build it with Xcode non-automatically because at least I know that Xcode works.

Any suggestions at all? Does anybody have OpenCV running on iOS? Which version?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-05-22 11:05:28 -0500

Hat Trick gravatar image

Eventually figured this out, I was not including the CoreVideo framework in the project. Kicking myself about wasting so much time.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-04-14 11:44:07 -0500

Seen: 987 times

Last updated: May 22 '14