使用Cocoapods

时间:2016-03-07 14:46:57

标签: ios xcode opencv cocoapods

我在我的项目中使用AFNetworking和另外两个使用cocoapods的框架,现在我想在同一个项目中添加opencv2.framework

这样做有什么不同的技巧吗? 因为当我在我的项目中添加opencv2.framework(已经使用cocoapods)时,它显示错误:

  
    

架构armv7的未定义符号:       " _CMTimeMake",引自:            - opencv2中的[CvVideoCamera createVideoDataOutput](cap_ios_video_camera.o)       " _AVCaptureSessionPresetLow",引自:            - opencv2中的[CvAbstractCamera createCaptureSession](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _AVCaptureSessionPresetHigh",引自:            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _AVCaptureSessionPreset352x288",引自:            - opencv2中的[CvAbstractCamera init](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _AVLayerVideoGravityResizeAspectFill",引自:            - opencv2中的[CvAbstractCamera createVideoPreviewLayer](cap_ios_abstract_camera.o)       " _AVVideoCodecKey",引自:            - opencv2中的[CvPhotoCamera createStillImageOutput](cap_ios_photo_camera.o)            - opencv2中的[CvVideoCamera createVideoFileOutput](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AVAssetReaderTrackOutput",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)       " _AVMediaTypeVideo",引自:            - opencv2中的[CvAbstractCamera createCaptureDevice](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera setDesiredCameraPosition:](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera lockFocus](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera unlockFocus](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera lockExposure](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera unlockExposure](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera lockBalance](cap_ios_abstract_camera.o)           ...       " _AVCaptureSessionPresetMedium",引自:            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _AVVideoHeightKey",引自:            - opencv2中的[CvVideoCamera createVideoFileOutput](cap_ios_video_camera.o)       " _AVVideoCodecH264",引自:            - opencv2中的[CvVideoCamera createVideoFileOutput](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AVAssetWriterInputPixelBufferAdaptor",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_video_camera.o)       " _AVVideoCodecJPEG",引自:            - opencv2中的[CvPhotoCamera createStillImageOutput](cap_ios_photo_camera.o)       " _AVVideoWidthKey",引自:            - opencv2中的[CvVideoCamera createVideoFileOutput](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AFNetworkReachabilityManager",引自:           在Config.o中为__ObjC.AFNetworkReachabilityManager键入元数据访问器       " _OBJC_CLASS _ $ _ AVAssetWriter",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureStillImageOutput",引自:           opencv2中的objc-class-ref(cap_ios_photo_camera.o)       " _AVCaptureSessionPreset640x480",引自:            - opencv2中的[CvAbstractCamera initWithParentView:](cap_ios_abstract_camera.o)            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AVAssetReader",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)       " _AVCaptureSessionPreset1280x720",引自:            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureVideoPreviewLayer",引自:           opencv2中的objc-class-ref(cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AVURLAsset",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)       " _CMSampleBufferGetImageBuffer",引自:            - opencv2中的[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:](cap_avfoundation.o)            - opencv2中的[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureVideoDataOutput",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_video_camera.o)       " _AVFileTypeMPEG4",引自:            - opencv2中的[CvVideoCamera createVideoFileOutput](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureDeviceInput",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureDevice",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AFHTTPRequestOperationManager",引自:           Constants.o中的l__CATEGORY_AFHTTPRequestOperationManager _ $ _           在Constants.o中为__ObjC.AFHTTPRequestOperationManager输入元数据访问器       " _CMSampleBufferGetPresentationTimeStamp",引自:            - opencv2中的[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:](cap_ios_video_camera.o)       " _OBJC_CLASS _ $ _ CLImageEditor",引自:           在MultiImagePickerViewController.o中为__ObjC.CLImageEditor键入元数据访问器       " _AVCaptureSessionPresetPhoto",引自:            - opencv2中的[CvAbstractCamera updateSize](cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AVCaptureSession",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_abstract_camera.o)       " _OBJC_CLASS _ $ _ AFHTTPResponseSerializer",引自:           在Config.o中为__ObjC.AFHTTPResponseSerializer键入元数据访问器       " _OBJC_CLASS _ $ _ AVAssetWriterInput",引自:           opencv2中的objc-class-ref(cap_avfoundation.o)           opencv2中的objc-class-ref(cap_ios_video_camera.o)       " _AFStringFromNetworkReachabilityStatus",引自:           静态.Config。(可达性(.Config.Type) - >((状态:Swift.String,connected:Swift.Bool) - >()) - >())。(封闭#1)在Config中。 Ø     ld:找不到架构armv7的符号     clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

  

但是当我在没有cocoapods的新项目中使用opencv2.framework时它工作正常

1 个答案:

答案 0 :(得分:2)

将您的项目与CoreMedia框架相关联。似乎还必须添加AVFoundation