问题:
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/nick/.Apps/opencv/modules/highgui/src/window.cpp, line 516
terminate called after throwing an instance of 'cv::Exception'
what(): /home/nick/.Apps/opencv/modules/highgui/src/window.cpp:516: 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
解决思路:
:opencv highgui模块,在linux下用到了GTK图形库,因此,在build opencv from source之前,需要装好GTK,然后在opencv的makefile中要把GTK开关开启(opencv2.4.13默认已开启),然后make编译opencv,此时的highgui模块,才可以正常工作。
参考:

当在Linux环境下使用OpenCV的highgui模块时,可能会遇到GTK+2.x错误。为了解决这个问题,需要在编译OpenCV源码前安装GTK,并确保在makefile中开启GTK选项。参照Stack Overflow上的解答和Zhihu上的讨论,完成这些步骤后,可以成功编译并使highgui模块正常工作。
报错:GTK+2.x error&spm=1001.2101.3001.5002&articleId=99460385&d=1&t=3&u=cbb74068af8f4908a5d59af45bc6b444)
4447

被折叠的 条评论
为什么被折叠?



