【opencv】——ubuntu源码安装opencv之后,编译通过后,运行报错:install libgtk2.0-dev and pkg-config, then re-run cmake or

完整报错:

OpenCV(3.4.1) 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 /media/data/914bd495-8af8-44c7-bc83-b389e496cbb3/backup/data/software/opencv-3.4.1/modules/highgui/src/window.cpp, line 618
terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(3.4.1) /media/data/914bd495-8af8-44c7-bc83-b389e496cbb3/backup/data/software/opencv-3.4.1/modules/highgui/src/window.cpp:618: 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

解决方案:

  1. 安装libgtk2.0-dev,pkg-config
sudo apt-get install libgtk2.0-dev pkg-config
  1. 重新编译opencv

可参考:【opencv】ubuntu安装opencv4.2.0(支持cuda加速)

你可能感兴趣的:(opencv)