【问题标题】:Unknown error compiling opencv framework: Undefined symbols: "_CGImageDestinationCreateWithURL"编译opencv框架的未知错误:未定义的符号:“_CGImageDestinationCreateWithURL”
【发布时间】:2012-02-02 06:00:18
【问题描述】:

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

【问题讨论】:

  • 你是如何导入框架的?
  • 不是 编译错误它是链接错误链接器告诉你它不能链接到某个符号您正在使用的名称。检查库路径等。
  • 同意的链接器错误不是编译器。石英.lib?
  • 好的,我解决了这个问题,我尝试导入的库有一些依赖项,所以我只导入库,一切正常。
  • 更多信息是“ImageIO.framework”

标签: c++ xcode opencv gcc


【解决方案1】:

为了以后的访客(比如我 ;-)),我报告了 Gustavo 的自我回答:

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

【讨论】:

    猜你喜欢
    • 2017-03-03
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 2022-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多