Xcode中macos开发导入opencv2

你说的曾经没有我的故事 提交于 2020-03-01 03:17:05
Undefined symbols for architecture 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)
  "_AVFileTypeAppleM4V", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVFileTypeMPEG4", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVFileTypeQuickTimeMovie", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_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)
  "_AVVideoCodecH264", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVVideoCodecJPEG", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVVideoCodecKey", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVVideoHeightKey", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_AVVideoWidthKey", referenced from:
      CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(char const*, int, double, CvSize, int) in opencv2(cap_avfoundation.o)
  "_CGColorSpaceCreateDeviceRGB", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGColorSpaceRelease", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGDataProviderCopyData", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGDataProviderCreateWithCFData", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGDataProviderRelease", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGImageCreate", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGImageGetBytesPerRow", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGImageGetDataProvider", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
  "_CGImageRelease", referenced from:
      CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) 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 from:
      objc-class-ref in opencv2(cap_avfoundation.o)
  "Server::mViewer", referenced from:
      Server::HandleClient(void*) in server.o
  "Server::mapFusing", referenced from:
      Server::HandleClient(void*) in server.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

在这里插入图片描述

按照之前在ios开发上导入opencv的经验,把opencv库文件和各种framework这些配置后,但是后续的运行中会遇到上面的错,后面才发现macos开发必须导入生成的dylib才行,ios不需要

屏幕有限,下图的dylib是不全的
在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!