现在的位置: 首页 > 综合 > 正文

OpenCV Error: Unspecified error (The function is not implemented…

2013年09月03日 ⁄ 综合 ⁄ 共 1057字 ⁄ 字号 评论关闭

初始安装好opencv2.4.1后测试时出现以下问题:(下面第一行为测试语句,系统为Ubuntu12.04)

----想不通的是明明已经安装了GTK+2.x这些东东

~$./DisplayImage lena.jpg
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file
/home/aborn/software/OpenCV-2.4.1/modules/highgui/src/window.cpp, line 598
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/aborn/software/OpenCV-2.4.1/modules/highgui/src/window.cpp:598: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config,
then re-run cmake or configure script in function cvNamedWindow

上网一查,发现有人也遇到过这个问题,如这个 csdn-topic   还有 yahoo的gruop-topic

最后在这个地方找到了解释,点击此处

简单的解释就是你的GTK+2.x要先于OpenCV安装,所以它给的解决方法是You should remove the current installation of opencv from your system; rebuild your opencv lib after installing
gtk dev lib in the correct path; and reinstall the compiled opencv lib. 


我按照这个方法,又重新用cmake-gui make sudo make install 重新安装了一遍,最后成功,如下图:


抱歉!评论已关闭.