c++ - 编译opencv框架的未知错误: Undefined symbols: "_CGImageDestinationCreateWithURL"

标签 c++ xcode opencv gcc

Xcode 给了我以下错误,我真的不知道该怎么办,这让我发疯了。 我正在导入一个 OpenCV 框架,所以问题可能存在或与编译器有关。 谁能告诉我要做什么或搜索什么?

      Undefined symbols:   "_CGImageDestinationCreateWithURL", referenced from:
      cv::ImageIOEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in OpenCV(grfmt_imageio.o)   "_CGImageDestinationAddImage", referenced from:
      cv::ImageIOEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in OpenCV(grfmt_imageio.o)   "_CGImageSourceCreateImageAtIndex", referenced from:
      cv::ImageIODecoder::readHeader()      in OpenCV(grfmt_imageio.o)   "_CGImageDestinationFinalize", referenced from:
      cv::ImageIOEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in OpenCV(grfmt_imageio.o)   "_CGImageSourceCreateWithURL", referenced from:
      cv::ImageIODecoder::readHeader()      in OpenCV(grfmt_imageio.o) ld: symbol(s) not found collect2: ld returned 1 exit status

最佳答案

为了将来的访客(像我一样;-)),我报告了 Gustavo 的 self 回答:

添加 "ImageIO.framework" 至 "链接的框架和库"

关于c++ - 编译opencv框架的未知错误: Undefined symbols: "_CGImageDestinationCreateWithURL",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8725100/

相关文章:

ios - 保持函数之间的定义

c++ - OpenCV、C++、使用 HoughLinesP 进行线检测

linux - 如何使用基于linux的平台在windows硬盘上构建linux共享库?

c++ - 基于 OpenGL 的 UI 的几何表示

c++ - 为什么 C++ 中的 vector 不会自动调整大小

c++ - Microsoft Visual C++ 2010 Express 安装/运行问题

python - OpenCV2 BatchDistance Error -215 在循环浏览图像时个别比较工作正常

c++ - 'pass variable by reference' 是如何工作的?

swift - SIGABRT 与 Xcode 使用 Swift

ios - 我如何在 Core Data 中对团队、比赛和主队/客队关系进行建模?