Ubuntu14.04安裝好opencv3.0.0之後,進行測試:
$./DisplayImage lena.jpg
出現以下問題:
OpenCV Error: Unspecified error (The function is notimplemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. Ifyou are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-runcmake or configure script) in cvNamedWindow, file/home/aborn/software/OpenCV-3.0.0/modules/highgui/src/window.cpp, line …
網上給的解釋是: GTK+2.x要先於OpenCV安裝(You should remove the current installation of opencv from yoursystem; rebuild your opencv lib after installing gtk dev lib in thecorrect path; and reinstall the compiled opencv lib. )
解決方法:
1.卸載opencv
(1)移除式卸載:apt-getremove 軟件名1 軟件名2 …;(移除軟件包)
(2)清除式卸載:apt-getpurge remove 軟件名1 軟件名2;(同時清除配置)
建議選擇清除式卸載
(3)卸載不管用的話,直接到opencv解壓目錄把解壓出的opencv包刪掉
2.查看沒安裝的文件,沒裝的裝上
之前安裝時的命令:
sudo apt-get install build-essential cmakelibgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
查看方法:
$ dpkg –listfiles cmake(查詢系統中屬於cmake的文件)
$ dpkg –listfiles libgtk2.0-dev(查詢系統中屬於libgtk2.0-dev的文件)
$ dpkg –listfiles 其他包名
3.重新安裝opencv並進行測試
可參考文章:Ubuntu14.04安裝opencv3.0.0:
http://blog.csdn.net/qingyanyichen/article/details/51621982