gpt4 book ai didi

c++ - OpenCV Apple Mach-O 链接器错误 - 体系结构 x86_64 的 undefined symbol

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:59:54 25 4
gpt4 key购买 nike

我正在尝试通过 xcode6 运行一个 opencv 项目。

现在,我想使用 Xcode 6 作为开发环境。但是我收到 Apple Mach-O Linker 错误。我在项目中添加 opencv2.framework。但我无法构建项目。那是错误;

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)

最佳答案

在 XCode 中:

  • 转到项目设置
  • 转到将二进制文件与库链接
  • 确保添加以下 iOS 框架:
    1) AVFoundation.framework
    2) AssetsLibrary.framework
    3) CoreMedia.framework
    4) CoreVideo.framework

它正在尝试使用具有相同名称的 openCV 方法,因此为其提供正确的 header ,您应该可以开始了。

感谢Erzekiel寻求灵感/帮助。

关于c++ - OpenCV Apple Mach-O 链接器错误 - 体系结构 x86_64 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32603840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com