Xcode中macos开发导入opencv2

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)

Xcode中macos开发导入opencv2_第1张图片

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

屏幕有限,下图的dylib是不全的
Xcode中macos开发导入opencv2_第2张图片

你可能感兴趣的:(mac,opencv,macos)