ios - 使用 Cocoapods 添加另一个框架

标签 ios xcode opencv cocoapods

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

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

Undefined symbols for architecture armv7: "_CMTimeMake", referenced from: -[CvVideoCamera createVideoDataOutput] in opencv2(cap_ios_video_camera.o) "_AVCaptureSessionPresetLow", referenced from: -[CvAbstractCamera createCaptureSession] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_AVCaptureSessionPresetHigh", referenced from: -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_AVCaptureSessionPreset352x288", referenced from: -[CvAbstractCamera init] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_AVLayerVideoGravityResizeAspectFill", referenced from: -[CvAbstractCamera createVideoPreviewLayer] in opencv2(cap_ios_abstract_camera.o) "_AVVideoCodecKey", referenced from: -[CvPhotoCamera createStillImageOutput] in opencv2(cap_ios_photo_camera.o) -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AVAssetReaderTrackOutput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_AVMediaTypeVideo", referenced from: -[CvAbstractCamera createCaptureDevice] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera setDesiredCameraPosition:] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera lockFocus] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera unlockFocus] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera lockExposure] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera unlockExposure] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera lockBalance] in opencv2(cap_ios_abstract_camera.o) ... "_AVCaptureSessionPresetMedium", referenced from: -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_AVVideoHeightKey", referenced from: -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_AVVideoCodecH264", referenced from: -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AVAssetWriterInputPixelBufferAdaptor", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_video_camera.o) "_AVVideoCodecJPEG", referenced from: -[CvPhotoCamera createStillImageOutput] in opencv2(cap_ios_photo_camera.o) "_AVVideoWidthKey", referenced from: -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AFNetworkReachabilityManager", referenced from: type metadata accessor for __ObjC.AFNetworkReachabilityManager in Config.o "_OBJC_CLASS_$_AVAssetWriter", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AVCaptureStillImageOutput", referenced from: objc-class-ref in opencv2(cap_ios_photo_camera.o) "_AVCaptureSessionPreset640x480", referenced from: -[CvAbstractCamera initWithParentView:] in opencv2(cap_ios_abstract_camera.o) -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AVAssetReader", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_AVCaptureSessionPreset1280x720", referenced from: -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AVCaptureVideoPreviewLayer", referenced from: objc-class-ref in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AVURLAsset", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) "_CMSampleBufferGetImageBuffer", referenced from: -[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o) -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AVCaptureVideoDataOutput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_video_camera.o) "_AVFileTypeMPEG4", referenced from: -[CvVideoCamera createVideoFileOutput] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_AVCaptureDeviceInput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AVCaptureDevice", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from: l__CATEGORY_AFHTTPRequestOperationManager_$_ in Constants.o type metadata accessor for __ObjC.AFHTTPRequestOperationManager in Constants.o "_CMSampleBufferGetPresentationTimeStamp", referenced from: -[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o) "_OBJC_CLASS_$_CLImageEditor", referenced from: type metadata accessor for __ObjC.CLImageEditor in MultiImagePickerViewController.o "_AVCaptureSessionPresetPhoto", referenced from: -[CvAbstractCamera updateSize] in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AVCaptureSession", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_abstract_camera.o) "_OBJC_CLASS_$_AFHTTPResponseSerializer", referenced from: type metadata accessor for __ObjC.AFHTTPResponseSerializer in Config.o "_OBJC_CLASS_$_AVAssetWriterInput", referenced from: objc-class-ref in opencv2(cap_avfoundation.o) objc-class-ref in opencv2(cap_ios_video_camera.o) "_AFStringFromNetworkReachabilityStatus", referenced from: static .Config.(reachability (.Config.Type) -> ((status : Swift.String, connected : Swift.Bool) -> ()) -> ()).(closure #1) in Config.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

最佳答案

将您的项目链接到 CoreMedia 框架。而且似乎还必须添加 AVFoundation

关于ios - 使用 Cocoapods 添加另一个框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35846637/

相关文章:

ios - UITextView 未在键盘中显示地球图标

ios - Facebook iOS SDK DemoApp 即使在配置 App ID 后也显示 "Sorry, an error has occurred"

ios - 从字符串 iOS Swift 中删除所有引号

ios - 同一 View 模型中有两种不同的模型类型? swift - Xcode?

xcode - 如何在 Xcode 的调试检查器中显示变量值

.net - C++ 和 Windows 窗体中的数组

c++ - 为什么 cv::circle() 只显示在特定 RGB 值的 3D 矩阵上?

ios - 迦太基 "--no-use-binaries"的用途是什么

ios - 在 CALayer 层次结构中组合多个 CAAnimation

iphone - 如何在iOS中分割图像以去除背景并保留前景图片