OpenCV Apple Mach-O链接器错误-架构x86_64的未定义符号
OpenCV Apple Mach-O Linker Error - Undefined symbols for architecture x86_64
我正在尝试运行xcode6的opencv项目。
现在我想使用Xcode 6作为开发环境。但我得到一个Apple Mach-O link错误。我在项目中添加了openv2 .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)
In XCode:
- 进入项目设置 链接二进制文件与库
- 确保添加了以下iOS框架:
1)AVFoundation.framework
2)AssetsLibrary.framework
3)CoreMedia.framework
4)CoreVideo.framework
它试图使用相同名称的openCV方法,所以提供正确的头,你应该很好去。
感谢Erzekiel的灵感/帮助。
相关文章:
- vscode g++链路故障:体系结构x86_64的未定义符号
- 体系结构x86_64的未定义符号:std:terminate(),typeinfo,运算符delete[],运算符new
- C++ 中 dlsym 的未定义符号
- 仅在 MacOS 上析构函数的未定义符号
- OSX clang++:用于 cpp 文件中显式实例化模板的体系结构x86_64的未定义符号
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - 体系结构的未定义符号 x86_64:
- 体系结构x86_64的未定义符号:链接器错误
- C++ std::vector<int> 体系结构的未定义符号 x86_64:
- 生成文件:体系结构x86_64的未定义符号
- libc++abi未定义符号:_ZTVN10__cxxabif120__si-class_type_infoE
- Xcode"体系结构x86_64的未定义符号"
- 体系结构x86_64的未定义符号:找不到原因
- SWIG链接器:未定义符号:_ZN2cv8fastFreeEPv(cv::fastFree(void*))
- 如何修复架构x86_64的未定义符号,Boost Asio 1.58
- 在Qt5上去静态库:架构的未定义符号x86_64:
- 体系结构x86_64的未定义符号:c++/ h 文件和 cpp 文件
- 监视 SDK 下的未定义符号"__Unwind_SjLj_Unregister"
- 使用 Boost/Python 的未定义符号 - 复杂
- 建筑x86_64的未定义符号:"vtkDebugLeaksManager::vtkDebugLeaksManager()",引用自: