【发布时间】:2015-04-30 19:31:18
【问题描述】:
我已经按照这些步骤安装了 OpenCV。在尝试编译一个示例后,我得到了这个错误:
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
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(threadTest)
find_package( OpenCV REQUIRED )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pthread")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "/home/nick/ClionProjects/threadTest")
set(SOURCE_FILES main.cpp)
add_executable(threadTest ${SOURCE_FILES})
target_link_libraries( threadTest ${OpenCV_LIBS} )
我该如何解决?
【问题讨论】:
-
只是阅读错误信息?它指出: 该功能未实现。使用 [..] GTK+ 2.x [..] 支持重建库。如果你在 Ubuntu 或 Debian 上,安装 libgtk2.0-dev 和 pkg-config,然后重新运行 cmake 或配置脚本 如果你不是在使用 Ubuntu 或 Debian,试着弄清楚 GTK 2.0 开发者包是如何被调用并与 pkg-config 一起安装。
-
我已经安装了 libgtk2.0-dev 但它没有帮助:(
-
CMke 找到了吗?看看输出。也许您必须将 Gtk 的路径指向 CMake。