简体   繁体   English

OpenCV Apple Mach-O链接器错误-体系结构x86_64的未定义符号

[英]OpenCV Apple Mach-O Linker Error - Undefined symbols for architecture x86_64

I am trying to run an opencv project by xcode6. 我正在尝试通过xcode6运行一个opencv项目。

Now, I want to use Xcode 6 as development environment. 现在,我想使用Xcode 6作为开发环境。 But I get an Apple Mach-O Linker error. 但是我收到一个Apple Mach-O Linker错误。 I add opencv2.framework in project. 我在项目中添加opencv2.framework。 But i can't build project. 但是我不能建立项目。 That is the error; 那是错误;

Ld /Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Products/Debug-iphonesimulator/OpenCVTest.app/OpenCVTest normal x86_64
    cd /Users/algorist/Desktop/Projeler/OpenCvTest/platforms/ios
    export IPHONEOS_DEPLOYMENT_TARGET=6.0
    export 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/iPhoneSimulator8.3.sdk -L/Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Products/Debug-iphonesimulator -F/Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Products/Debug-iphonesimulator -FOpenCVTest/Plugins/com.algorist.ocr -filelist /Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Intermediates/OpenCVTest.build/Debug-iphonesimulator/OpenCVTest.build/Objects-normal/x86_64/OpenCVTest.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework AssetsLibrary /Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Products/Debug-iphonesimulator/libCordova.a -framework CoreGraphics -framework MobileCoreServices -framework TesseractOCR -framework opencv2 -framework AVFoundation -framework QuartzCore -framework Accelerate -framework GLKit -lstdc++.6.0.9 -framework CoreImage -lc++ -Xlinker -dependency_info -Xlinker /Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Intermediates/OpenCVTest.build/Debug-iphonesimulator/OpenCVTest.build/Objects-normal/x86_64/OpenCVTest_dependency_info.dat -o /Users/algorist/Library/Developer/Xcode/DerivedData/OpenCVTest-gngmfszrvncpuqfhljuggdtereui/Build/Products/Debug-iphonesimulator/OpenCVTest.app/OpenCVTest

Undefined symbols for architecture x86_64:
  "_CVBufferRelease", referenced from:
      -[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o)
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
  "_CVBufferRetain", referenced from:
      -[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o)
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
  "_CVPixelBufferCreate", referenced from:
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferCreateWithBytes", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CVPixelBufferGetBaseAddress", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetBaseAddressOfPlane", referenced from:
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetBytesPerRow", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetBytesPerRowOfPlane", referenced from:
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetHeight", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetHeightOfPlane", referenced from:
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetPixelFormatType", referenced from:
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetWidth", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferGetWidthOfPlane", referenced from:
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferLockBaseAddress", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_CVPixelBufferRelease", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o)
      CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
      -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
  "_kCVPixelBufferCGBitmapContextCompatibilityKey", referenced from:
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
  "_kCVPixelBufferCGImageCompatibilityKey", referenced from:
      -[CvVideoCamera pixelBufferFromCGImage:] in opencv2(cap_ios_video_camera.o)
  "_kCVPixelBufferHeightKey", referenced from:
      CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o)
      CvCaptureCAM::setWidthHeight() in opencv2(cap_avfoundation.o)
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
      CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o)
      CvCaptureCAM::setWidthHeight() in opencv2(cap_avfoundation.o)
      CvCaptureFile::CvCaptureFile(char const*) in opencv2(cap_avfoundation.o)
      -[CvVideoCamera createVideoDataOutput] in opencv2(cap_ios_video_camera.o)
      -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o)
  "_kCVPixelBufferWidthKey", referenced from:
      CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o)
      CvCaptureCAM::setWidthHeight() in opencv2(cap_avfoundation.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In XCode: 在XCode中:

  • Go to project settings 转到项目设置
  • Go to Link Binary With Libraries 转到将二进制文件与库链接
  • Make sure that the following iOS Frameworks are added: 确保添加了以下iOS框架:
    1) AVFoundation.framework 1) AVFoundation.framework
    2) AssetsLibrary.framework 2) AssetsLibrary.framework
    3) CoreMedia.framework 3) CoreMedia.framework
    4) CoreVideo.framework 4) CoreVideo.framework

It's trying to use the openCV methods with the same name, so supply it with the right headers and you should be good to go. 它正在尝试使用具有相同名称的openCV方法,因此为它提供正确的标题,您应该一切顺利。

Thanks to Erzekiel for the inspiration/help. 感谢Erzekiel的启发/帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Apple Mach O-Linker错误Xcode(C ++):体系结构x86_64的未定义符号 - Apple Mach O-Linker Error Xcode (C++): Undefined symbols for architecture x86_64 链接器错误:“架构 x86_64 的未定义符号” - Linker error: "Undefined symbols for architecture x86_64" 架构 x86_64 的未定义符号:linker 错误 - Undefined symbols for architecture x86_64: linker error 体系结构x86_64参考链接器错误的未定义符号 - Undefined symbols for architecture x86_64 reference linker error Apple Mach-O链接器错误:体系结构armv7 Google Protobuf的未定义符号 - Apple Mach-O linker error: Undefined symbols for architecture armv7 Google Protobuf OpenCV架构x86_64的未定义符号:错误 - OpenCV Undefined symbols for architecture x86_64: error 带有xcode错误的OpenCV:体系结构x86_64的未定义符号: - OpenCV with xcode error: Undefined symbols for architecture x86_64: clang ++链接器未定义的符号,用于体系结构x86_64 - clang++ linker undefined symbols for architecture x86_64 体系结构x86_64的未定义符号,链接器命令失败 - Undefined symbols for architecture x86_64, linker command failed 架构x86_64的未定义符号,优胜美地上带有OpenCV的链接器问题 - Undefined symbols for architecture x86_64, linker issues on Yosemite with OpenCV
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM