【问题标题】:Can't use imshow in xcode 5 on OSX 10.8无法在 OSX 10.8 上的 xcode 5 中使用 imshow
【发布时间】:2015-05-06 12:21:33
【问题描述】:

我有点困惑,因为我不能使用 opencv 库中的 imshow。我使用了 opencv 中的许多其他功能,但是当我想显示我的矩阵/图像时出现此错误。

Undefined symbols for architecture x86_64:
  "cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in main.o
  "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

引发此错误的代码行/函数是:

cvStartWindowThread();
namedWindow("DisplayImage", WINDOW_AUTOSIZE);
imshow("Display Image", img_bgr);

img_bgr 是我想要的矩阵。

我正在使用 Xcode 5.1.1 开发 OSX 10.8.5,并且通过 this walkthrough 安装了 opencv-2.4.10。

任何人有一个想法,可以帮助我为什么不能调用上述函数?我搜索了有关此问题的线程,但似乎没有一个令人满意。

编辑:

现在已经卸载并安装了两次 OpenCV。一次是使用 Cmake 本身(作为应用程序),一次是在 this tutorial 的帮助下。没有解决仍然会出现相同的错误。 没人知道吗?

【问题讨论】:

  • 您是否将正确的标志传递给链接器(路径、opencv 库的名称?
  • 我刚刚关注了这个walkthrough。不成功...

标签: c++ xcode macos opencv imshow


【解决方案1】:

经过几次试验/数小时的故障排除后,我终于让它运行起来了。这是一种压路机战术,但无论如何。我刚刚格式化了我的笔记本电脑并在一个新分区上安装了 10.10 Yosemite。 在使用 OpenCV 进行一些 building issues(最初是 explained heresolved here)之后,它现在可以完美运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-10
    • 1970-01-01
    • 1970-01-01
    • 2014-03-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多