opencv安装错误集锦

1. 缺少libgtk2.0-dev 软件包(类似缺少软件包的问题)

百度如何安装libgtk2.0-dev 软件包,安装即可。

2. 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

百度这个问题,尝试别人的方法后依然没有解决。由于我安装的是opencv3.3.0,在安装了gtk,libgtk2.0-dev,pkg-config之后,发现有可能没有安装opencv_contrib-3.3.0,后来下载了一个,网址http://blog.csdn.net/wyx100/article/details/73461786。重新在opencv3.3.0目录下安装了一遍opencv就成功了。

测试程序:cd到opencv-3.4.0/smaples/cpp/example_cmake目录下  

mkdir build

cd build

cmake ..

make

./opencv_example

未完待续,之前就出现这两个主要问题,困扰了我三四天。


你可能感兴趣的:(opencv安装错误集锦)