简体   繁体   English

适用于iOS的OpenCV-链接Xcode中的库

[英]OpenCV for iOS - Linking Libraries in Xcode

As part of a team project I intend to implement obstacle detection for a robot using open cv. 作为团队项目的一部分,我打算使用开放式简历为机器人实现障碍物检测。 I am now at a point where I have functional code that runs on OS X and uses my laptop camera to detect obstacles approaching it. 现在,我拥有在OS X上运行的功能代码,并使用笔记本电脑摄像头检测接近它的障碍。 However the robot runs iOS (it is an iPad at heart) and thus requires me to build for iOS. 但是,该机器人运行iOS(心脏是iPad),因此需要我针对iOS进行构建。 Obviously the linker now doesn't accept the OS X library files, because of architecture mismatches. 显然,由于体系结构不匹配,链接器现在不接受OS X库文件。 So far it is set up as follows: 到目前为止,其设置如下:
1. /usr/local/lib added to Library Search Paths 1.将/usr/local/lib添加到Library Search Paths
2. /usr/local/include added to Header Search Paths 2. /usr/local/include添加到Header Search Paths
3. c++ language dialect changed to C++11 3.将C ++语言方言更改为C++11
4. Libraries added to Other Linker Flags ( -lopencv_calib3d etc.) 4.库已添加到Other Linker Flags-lopencv_calib3d等)
5. Valid Architectures set to i386 , x86_64 5. Valid Architectures设置为i386x86_64

In order to perform the necessary modifications for iOS I first of all changed the valid architectures to armv7 , armv7s , and arm64 . 为了对iOS执行必要的修改,我首先将有效架构更改为armv7armv7sarm64 Then I attempted to follow the instructions on OpenCV:Installation in iOS , asking me to execute the opencv/platforms/ios/build_framework.py script. 然后,我尝试遵循有关iOS中OpenCV:Installation的说明,要求我执行opencv/platforms/ios/build_framework.py脚本。 This built a framework file and a folder build . 这种内置的框架文件以及文件夹build I added the framework file to my Xcode project via Build Phases -> Link Binary With Libraries. 我通过Build Phases > Link Binary With Libraries.将框架文件添加到我的Xcode项目中Link Binary With Libraries. According to the python script's readme "The script builds OpenCV.framework for iOS. The built framework is universal, it can be used to build app and run it on either iOS simulator or real device." 根据python脚本的readme “该脚本为iOS构建OpenCV.framework。构建的框架具有通用性,可用于构建应用程序并在iOS模拟器或真实设备上运行。” However when I try to build the product for iOS simulator (amongst others), I get uncountable Undefined symbols for architecture x86_64 linker errors. 但是,当我尝试构建适用于iOS模拟器的产品(以及其他产品)时,出现Undefined symbols for architecture x86_64链接器Undefined symbols for architecture x86_64错误的无法计数的Undefined symbols for architecture x86_64 As far as I am aware there is nothing else to the installation instructions linked above though. 据我所知,上面链接的安装说明没有其他内容。

Am I missing something here? 我在这里想念什么吗? Adjusting header/library search paths to include either nothing or the OS X OpenCV library files from /usr/local/lib was to no avail. 调整标头/库搜索路径以使其不包含任何内容或/usr/local/lib中的OS X OpenCV库文件均无济于事。 My intuition is that is has something to do with the folder build created by the python script alongside the opencv2.framework file. 我的直觉是,这与python脚本与opencv2.framework文件一起创建的文件夹build opencv2.framework The contents of build are the folders: build的内容是以下文件夹:
iPhoneOS-arm64 iPhoneOS-arm64
iPhoneOS-armv7 iPhoneOS-armv7
iPhoneOS-armv7s iPhoneOS-armv7s
iPhoneSimulator-i386 iPhone模拟器-i386
iPhoneSimulator-x86_64 iPhone模拟器-x86_64

These in turn are comprised of: 这些依次包括:

在此处输入图片说明

Do I need to link any part of these folders into my project? 我需要将这些文件夹的任何部分链接到我的项目中吗?

I am grateful for any advice. 我很感谢任何建议。

Warm regards, 温暖的问候,
Mark 标记

EDIT: Here are the linker errors I get when compiling for iOS simulator. 编辑:这是为iOS模拟器编译时遇到的链接器错误。 When compiling for another architecture x (for example armv7) I get the exact same errors, differing only in the line Undefined symbols for architecture x . 当为另一种架构x(例如armv7)进行编译时,我得到了完全相同的错误,仅在Undefined symbols for architecture x行中有所不同。

Ld /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL normal x86_64 cd "/Users/schuegrafm/Documents/SS15/CooperativeRobots/Double IRL Project/Double_IRL" 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.4.sdk -L/Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Debug-iphonesimulator -F/Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Debug-iphonesimulator -F/Users/schuegrafm/Documents/SS15/CooperativeRo Ld /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL normal x86_64 cd“ / Users / schuegrafm / Documents / SS15 / CooperativeRobots / Double IRL Project / Double_IRL“导出IPHONEOS_DEPLOYMENT_TARGET = 6.0导出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.4.sdk -L / Users / schuegrafm / Documents / SS15 / CooperativeRobots / SDK / DoubleBasicHelloWorld / build / Debug-iphonesimulator -F / Users / schuegrafm / Documents / SS15 / CooperativeRobots / SDK / DoubleBasicHelloWorld / build / Debug-iphonesimulator -F / Users / schuegrafm / Documents / SS15 / CooperativeRo bots/Double\\ IRL\\ Project/Double_IRL/.. -F/Users/schuegrafm/Documents/Programming_Tools/ios -filelist /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -stdlib=libc++ -mios-simulator-version-min=6.0 -framework opencv2 -framework DoubleControlSDK -framework ExternalAccessory -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL_dependency_info.dat -o /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL bots / Double \\ IRL \\ Project / Double_IRL /..- F / Users / schuegrafm / Documents / Programming_Tools / ios -filelist /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator /Double_IRL.build/Objects-normal/x86_64/Double_IRL.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -stdlib = libc ++ -mios-simulator-version-min = 6.0-框架opencv2-框架DoubleControlSDK-框架ExternalAccessory-框架UIKit-框架Foundation-框架CoreGraphics -Xlinker -dependency_info -Xlinker / Users / schuegrafm / Documents / SS15 / CooperativeRobots / SDK / DoubleBasicHelloWorld / build / Double_IRL.build / Debug-iphonesimulator / Double_IRL。 build / Objects-normal / x86_64 / Double_IRL_dependency_info.dat -o /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL

Undefined symbols for architecture x86_64: 架构x86_64的未定义符号:
"_AVCaptureSessionPresetMedium", referenced from: CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o) "_AVFileType3GPP", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVCaptureSessionPresetMedium”,引用自opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)“ _AVFileType3GPP”,引用自:CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)。 o)
"_AVFileTypeAppleM4V", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVFileTypeAppleM4V”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVFileTypeMPEG4", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVFileTypeMPEG4”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVFileTypeQuickTimeMovie", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVFileTypeQuickTimeMovie”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVMediaTypeVideo", referenced from: CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o) CvCaptureFile::CvCaptureFile(char const*) in opencv2(cap_avfoundation.o) CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVMediaTypeVideo”,引用自:opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)opencv2(cap_avfoundation.o)中的CvCaptureFile :: CvCaptureFile(char const *)CvVideoWriter_AVFoundation :: CvVideoWriter_ *,int(char) opencv2(cap_avfoundation.o)中的CvSize,int)
"_AVVideoCodecH264", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVVideoCodecH264”,引用自opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVVideoCodecJPEG", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVVideoCodecJPEG”,引用自opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVVideoCodecKey", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVVideoCodecKey”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVVideoHeightKey", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVVideoHeightKey”,引用自opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_AVVideoWidthKey", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) “ _AVVideoWidthKey”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)
"_CMSampleBufferGetImageBuffer", referenced from: -[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CMSampleBufferInvalidate", referenced from: CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CMTimeMake", referenced from: CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o) CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o) 从以下位置引用的“ _CMSampleBufferGetImageBuffer”:-在opencv2(cap_avfoundation.o)中的[[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]]在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在“ _CMSampleBufferGetImageBuffer”中,从以下位置引用:在opencv2(cap_avfoundation.o)中的“ _CMTimeMake”中,引用自:opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)在opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)
"_CMVideoFormatDescriptionGetPresentationDimensions", referenced from: CvCaptureCAM::getProperty(int) const in opencv2(cap_avfoundation.o) "_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) "_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_avfounda opencv2(cap_avfoundation.o)中的CvCaptureCAM :: getProperty(int)常量引用的“ _CMVideoFormatDescriptionGetPresentationDimensions”,_ CVBufferRelease中引用的“ _CVBufferRelease”引用:opencv2(cap_avfoundation)中的-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]。在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在“ _CVBufferRetain”中,引用自:-在opencv2(cap_avfoundation.o)中的-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]-在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在opencv2(cap_avfoundation.o)中的“ _CVPixelBufferCreateWithBytes”,引用自:CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)在opencv2(cap_BufferfoundCate上,从“ CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)”) -opencv2(cap_avfoundation.o)中的[CaptureDelegate updateImage] CopenCap2(cap_avfounda)中的CvCaptureFile :: retrieveFramePixelBuffer() tion.o) "_CVPixelBufferGetBytesPerRow", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetHeight", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetWidth", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferLockBaseAddress", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.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::retriev tion.o)“ _CVPixelBufferGetBytesPerRow”,引用自:-opencv2(cap_avfoundation.o)中的[[CaptureDelegate updateImage] (cap_avfoundation.o)opencv2中的CvCaptureFile :: retrieveFramePixelBuffer()(_cap_avfoundation.o)“ _CVPixelBufferGetWidth”,引用自:opencv2中的-[CaptureDelegate updateImage](cap_avfoundation.o)CvCaptureFile :: retrieveFramePavelation()。 “ _CVPixelBufferLockBaseAddress”,从以下位置引用:-opencv2(cap_avfoundation.o)中的[[CaptureDelegate updateImage]。 (cap_avfoundation.o)“ _CVPixelBufferUnlockBaseAddress”,引用自:opencv2中的-[CaptureDelegate updateImage](cap_avfoundation.o)CvCaptureFile :: retriev eFramePixelBuffer() in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVAssetReader", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVAssetReaderTrackOutput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVAssetWriter", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVAssetWriterInput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVAssetWriterInputPixelBufferAdaptor", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVCaptureDevice", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVCaptureDeviceInput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVCaptureSession", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVCaptureVideoDataOutput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_OBJC_CLASS_$_AVURLAsset", referenced fr opencv2(cap_avfoundation.o)中的eFramePixelBuffer()“ _OBJC_CLASS _ $ _ AVAssetReader”,引用自:opencv2(obj_classfound.o)中的objc-class-ref“ _OBJC_CLASS _ $ _ AVAssetReaderTrackOutput”,引用于:objc-class(ref openc中的avc。 o)“ _OBJC_CLASS _ $ _ AVAssetWriter”,引用自:opencv2(obj_class)中的objc-class-ref(cap_avfoundation.o)“ _OBJC_CLASS _ $ _ AVAssetWriterInput”,引用自:opencv2(obj_class_ref)中的objc-class-ref(cap_avfoundation.o)引用自:opencv2(obj_class)中的objc-class-ref“ _OBJC_CLASS _ $ _ AVCaptureDevice”,引用来自:opencv2(cap_avfoundation.o)中的objc-class-ref“ _OBJC_CLASS _ $ _ AVCaptureDeviceInput”,引用自:objc-class-ref在opencv2(cap_avfoundation.o)中的“ _OBJC_CLASS _ $ _ AVCaptureSession”中,引用自:opencv2(cap_avfoundation.o)中的objc-class-ref。 _OBJC_CLASS _ $ _ AVURLAsset”,引用为fr om: objc-class-ref in opencv2(cap_avfoundation.o) "_kCMTimeZero", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) om:opencv2(cap_avfoundation.o)中的objc-class-ref“ _kCMTimeZero”,引用自:cvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)在opencv2(cap_avfoundation.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) "_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 “ _kCVPixelBufferHeightKey”,引用自:opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)opencv2(cap_avfoundation.o)中的CvCaptureCAM :: setWidthHeight()“ _kCVPixelBufferPixelFormatTypeKey”,引用自:CvCaptureCAM int2 (cap_avfoundation.o)opencv2中的CvCaptureCAM :: setWidthHeight()(cap_avfoundation.o)CvCaptureFile :: CvCaptureFile(char const *)在opencv2(cap_avfoundation.o)中(cap_avfoundation.o)opencv2中的CvCaptureCAM :: setWidthHeight()(cap_avfoundation.o)ld:架构x86_64找不到符号

EDIT2: Errors left after adding AV foundation framework. EDIT2:添加AV基础框架后遗留的错误。

Ld /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL normal x86_64 cd "/Users/schuegrafm/Documents/SS15/CooperativeRobots/Double IRL Project/Double_IRL" 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.4.sdk -L/Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Debug-iphonesimulator -F/Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Debug-iphonesimulator -F/Users/schuegrafm/Documents/SS15/CooperativeRo Ld /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL normal x86_64 cd“ / Users / schuegrafm / Documents / SS15 / CooperativeRobots / Double IRL Project / Double_IRL“导出IPHONEOS_DEPLOYMENT_TARGET = 6.0导出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.4.sdk -L / Users / schuegrafm / Documents / SS15 / CooperativeRobots / SDK / DoubleBasicHelloWorld / build / Debug-iphonesimulator -F / Users / schuegrafm / Documents / SS15 / CooperativeRobots / SDK / DoubleBasicHelloWorld / build / Debug-iphonesimulator -F / Users / schuegrafm / Documents / SS15 / CooperativeRo bots/Double\\ IRL\\ Project/Double_IRL/.. -F/Users/schuegrafm/Documents/Programming_Tools/ios -filelist /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -stdlib=libc++ -mios-simulator-version-min=6.0 -framework AVFoundation -framework opencv2 -framework DoubleControlSDK -framework ExternalAccessory -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL_dependency_info.dat -o /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64/Double_IRL bots / Double \\ IRL \\ Project / Double_IRL /..- F / Users / schuegrafm / Documents / Programming_Tools / ios -filelist /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator /Double_IRL.build/Objects-normal/x86_64/Double_IRL.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -stdlib = libc ++ -mios-simulator-version-min = 6.0-框架AVFoundation-框架opencv2-框架DoubleControlSDK-框架ExternalAccessory-框架UIKit-框架基础-框架CoreGraphics -Xlinker -dependency_info -Xlinker /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRLsim.build/Debug-iphone /Double_IRL.build/Objects-normal/x86_64/Double_IRL_dependency_info.dat -o /Users/schuegrafm/Documents/SS15/CooperativeRobots/SDK/DoubleBasicHelloWorld/build/Double_IRL.build/Debug-iphonesimulator/Double_IRL.build/Objects-normal/x86_64 / Double_IRL

Undefined symbols for architecture x86_64: 架构x86_64的未定义符号:
"_CMSampleBufferGetImageBuffer", referenced from: -[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CMSampleBufferInvalidate", referenced from: CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CMTimeMake", referenced from: CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o) CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o) 从以下位置引用的“ _CMSampleBufferGetImageBuffer”:-在opencv2(cap_avfoundation.o)中的[[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]]在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在“ _CMSampleBufferGetImageBuffer”中,从以下位置引用:在opencv2(cap_avfoundation.o)中的“ _CMTimeMake”中,引用自:opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)在opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)
"_CMVideoFormatDescriptionGetPresentationDimensions", referenced from: CvCaptureCAM::getProperty(int) const in opencv2(cap_avfoundation.o) "_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) "_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_avfounda opencv2(cap_avfoundation.o)中的CvCaptureCAM :: getProperty(int)常量引用的“ _CMVideoFormatDescriptionGetPresentationDimensions”,_ CVBufferRelease中引用的“ _CVBufferRelease”引用:opencv2(cap_avfoundation)中的-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]。在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在“ _CVBufferRetain”中,引用自:-在opencv2(cap_avfoundation.o)中的-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]-在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()在opencv2(cap_avfoundation.o)中的“ _CVPixelBufferCreateWithBytes”,引用自:CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)在opencv2(cap_BufferfoundCate上,从“ CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)”) -opencv2(cap_avfoundation.o)中的[CaptureDelegate updateImage] CopenCap2(cap_avfounda)中的CvCaptureFile :: retrieveFramePixelBuffer() tion.o) "_CVPixelBufferGetBytesPerRow", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetHeight", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetWidth", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferLockBaseAddress", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.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::retriev tion.o)“ _CVPixelBufferGetBytesPerRow”,引用自:-opencv2(cap_avfoundation.o)中的[[CaptureDelegate updateImage] (cap_avfoundation.o)opencv2中的CvCaptureFile :: retrieveFramePixelBuffer()(_cap_avfoundation.o)“ _CVPixelBufferGetWidth”,引用自:opencv2中的-[CaptureDelegate updateImage](cap_avfoundation.o)CvCaptureFile :: retrieveFramePavelation()。 “ _CVPixelBufferLockBaseAddress”,从以下位置引用:-opencv2(cap_avfoundation.o)中的[[CaptureDelegate updateImage]。 (cap_avfoundation.o)“ _CVPixelBufferUnlockBaseAddress”,引用自:opencv2中的-[CaptureDelegate updateImage](cap_avfoundation.o)CvCaptureFile :: retriev eFramePixelBuffer() in opencv2(cap_avfoundation.o) "_kCMTimeZero", referenced from: CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o) opencv2(cap_avfoundation.o)中的eFramePixelBuffer()“ _kCMTimeZero”,引用自:cvVideoWriter_AVFoundation :: CvVideoWriter_AVFoundation(char const *,int,double,CvSize,int)在opencv2(cap_avfoundation.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) "_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) “ _kCVPixelBufferHeightKey”,引用自:opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)opencv2(cap_avfoundation.o)中的CvCaptureCAM :: setWidthHeight()“ _kCVPixelBufferPixelFormatTypeKey”,引用自:CvCaptureCAM int2 (cap_avfoundation.o)opencv2中的CvCaptureCAM :: setWidthHeight()(cap_avfoundation.o)CvCaptureFile :: CvCaptureFile(char const *)在opencv2(cap_avfoundation.o)中(cap_avfoundation.o)opencv2中的CvCaptureCAM :: setWidthHeight()(cap_avfoundation.o)ld:找不到架构x86_64的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

EDIT3: Remaining 14 errors. EDIT3:剩余14个错误。

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) "_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) "_CVPixelBufferGetBytesPerRow", referenced from: -[CaptureDelegate updateImage] in openc 架构x86_64的未定义符号:“ _ CVBufferRelease”,引用自:opencv2(cap_avfoundation.o)中的-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] -opencv2(cap_avfoundation.o)中的[CaptureDelegate updateImage] CvCaptureel:open(2) (cap_avfoundation.o)“ _CVBufferRetain”,引用自:opencv2(cap_avfoundation.o)中的[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:]-opencv2(cap_avfoundation.o)中的[CaptureDelegate updateImage] CvCaptureFile :: retrieveFramePixelc cap_avfoundation.o)“ _ CVPixelBufferCreateWithBytes”,引用自:opencv2(Cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)。 ()在opencv2(cap_avfoundation.o)“ _CVPixelBufferGetBytesPerRow”中,引用自:openc中的-[CaptureDelegate updateImage] v2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetHeight", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferGetWidth", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o) "_CVPixelBufferLockBaseAddress", referenced from: -[CaptureDelegate updateImage] in opencv2(cap_avfoundation.o) CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.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) "_kCVPixelBufferHeightKey", referenced from: v2(cap_avfoundation.o)Opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()“ _CVPixelBufferGetHeight”,引用自opencv2(cap_avfoundation.o)中的-[CaptureDelegate updateImage] CvCaptureFile :: recapeve_in2(cap_avfoundation.o) )“ _CVPixelBufferGetWidth”,引用来自:opencv2(cap_avfoundation.o)中的-[CaptureDelegate updateImage] CvCaptureFile :: opencv2(cap_avfoundation.o)的retrieveFramePixelBuffer()。 o)opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()“ _CVPixelBufferRelease”,引用自:opencv2(cap_avfoundation.o)中的CvVideoWriter_AVFoundation :: writeFrame(_IplImage const *)“ _CVPixeltureCaptureDeleteDeleteDeleteDeleteDate:在opencv2(cap_avfoundation.o)中的CvCaptureFile :: retrieveFramePixelBuffer()中的“ _kCVPixelBufferHeightKey”,引用自: 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) "_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) opencv2(cap_avfoundation.o)中的CvCaptureCAM :: startCaptureDevice(int)opencv2(cap_avfoundation.o)中的CvCaptureCAM :: setWidthHeight()“ _kCVPixelBufferPixelFormatTypeKey”,引用自opencv2CAM(_cap)中的CvCaptureCAM :: startCaptureDevice(int)C: opencv2(cap_avfoundation.o)中的:setWidthHeight()C:opencv2(cap_avfoundation.o)中的CvCaptureFile :: CvCaptureFile(char const *) :opencv2(cap_avfoundation.o)中的:setWidthHeight()ld:针对体系结构x86_64铛未找到符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)

Take a look on tutorials for iOS on official OpenCV site. 在官方OpenCV网站上查看iOS 教程 You will there information about dependencies. 您将获得有关依赖项的信息。

To import OpenCV 3 into your Xcode 8 project: 要将OpenCV 3导入Xcode 8项目:

  1. Install 'OpenCV2' with Cocoapods (it says '2', but it's still version 3). 在Cocoapods上安装“ OpenCV2”(显示为“ 2”,但仍为版本3)。 Don't install the 'devel' build. 不要安装“开发”版本。

  2. Open your project in the workspace Cocoapods created for you — not the project file you created — and append every implementation file that uses OpenCV with .mm (versus .m). 在为您创建的工作区Cocoapods中打开您的项目(而不是您创建的项目文件),然后将每个使用OpenCV的实现文件附加到.mm(相对于.m)中。 You'll get strange error messages if you don't. 否则,您会收到奇怪的错误消息。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM