opencv2.framework无法使用链接器标志-ObjC进行编译

时间:2014-05-13 15:04:35

标签: ios objective-c xcode opencv linker-flags

我正在使用 opencv opencv 2.4.9)的最新版本,我必须拥有 Core Plot所需的 -ObjC标志 (绘图框架)。

当我在其他标志中设置 -ObjC 时,我收到了很多类型为Undefined symbols for architecture i386的错误(实际上是28个),如下所示:

Undefined symbols for architecture i386:
"_CMSampleBufferGetImageBuffer", referenced from:
-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o)
CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
-[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
"_CMSampleBufferGetPresentationTimeStamp", referenced from:
-[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.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)
-[CvVideoCamera createVideoDataOutput] in opencv2(cap_ios_video_camera.o)
"_CMVideoFormatDescriptionGetPresentationDimensions", referenced from:
CvCaptureCAM::getProperty(int) 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)
... etc

问题与Bartosz Bialecki相同,我尝试了提出的解决方案,但问题仍然存在。

有没有人有想法?

编辑:

以下是我所包含的所有框架:

enter image description here

3 个答案:

答案 0 :(得分:10)

问题解决了添加几个框架: CoreVideo.frameworkAssetsLibrary.frameworkCoreMedia.framework

以下是所包含框架的完整列表: enter image description here

答案 1 :(得分:1)

下面是您需要导入项目以建立成功的列表框架。这是relate link

AVFoundation
opencv2

Accelerate

AssetsLibrary

CoreGraphics

CoreImage

CoreMedia

CoreVideo

QuartzCore

UIKit

答案 2 :(得分:-1)

添加以下框架对我有用

  • AVFoundation
  • CoreMedia
  • 素材资源库
  • corevideo的