Problem Description:
ubuntu@ubuntu:~/opencv-3.3.0/cpp_luckynote/opencv_lena$./displayimage. /lfw/anna_chicherova/anna_chicherova_0001.jpg
OpenCV error:unspecified Error (the function is not implemented. Rebuild the library with Windows, GTK + 2.x or Carbon support. If you are are on Ubuntu or Debian, install Libgtk2.0-dev and pkg-config, then re-run or cmake script) in configure Dow, File/opt/conda/conda-bld/opencv_1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp, line 527
terminate called after throwing a instance of ' cv::exception ' What
(): /opt/conda/conda-bld/opencv_ 1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp:527:error: ( -2) The function is not implemented. Rebuild the library with Windows, GTK + 2.x or Carbon support. If you are are on Ubuntu or Debian, install Libgtk2.0-dev and pkg-config, then re-run or CMake script in function cv Namedwindow
has been discarded (core has been dumped)
Obviously already install Libgtk2.0-dev and pkg-config Why also reported the above error, the above error reminding and the net Netizen gives the explanation, may think, before installs OpenCV must install the Libgtk2.0-dev and Pkg-config, after installing them both or forgetting to install will report the above error.
But the author has opencv complete uninstall and CMake compiled after the installation, will still report the above problems, reinstall, restart the system, installation of different versions have tried, or an error, how to break. The author on this above toss all day, finally solved.
The solution is as follows:
A. First complete uninstall OPENCV, and delete all the files related to Opencv, complete delete Opencv method See "Ubuntu-opencv" Ubuntu14.04 Opencv3.3.0 complete Uninstall scheme;
B. Then remember to uninstall the Libgtk2.0-dev first, uninstall the program as follows:
sudo apt-get autoremove gtk+-2.0
sudo apt-get install Gnome-core-devel
sudo apt-get install Libgtk2.0-dev or sudo apt-get install libgtk2.0* (I am using the previous installation)
Pkg-config–modversion gtk+-2.0 installed You can use this command to view the gtk+-2.0 installation version.
C. Finally CMake installation OPENCV, installation method Reference "UBUNTU-OPENCV" Ubuntu14.04 Opencv3.3.0 installation configuration and test
According to the above ABC, I have solved the above problem perfectly