【发布时间】: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