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 cvWaitKey, file /Users/apple/Documents/project/demo/opencv/opencv-master/modules/highgui/src/window.cpp, line 616
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/apple/Documents/project/demo/opencv/opencv-master/modules/highgui/src/window.cpp:616: 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 cvWaitKey
求帮助 coding
char c = cvWaitKey(33);
        if (c == 27) {
            break;
        }

解决方案 »

  1.   

    break是跳出循环用的,你写在if中干嘛?
      

  2.   

    while(1) {
    .....................
    char c = cvWaitKey(33);
            if (c == 27) {
                break;
            }
    }是这样的,哈哈
      

  3.   

    你#include <cv.h>了吗?
      

  4.   

    你在编译OpenCV的时候,要加上:WITH_GTK=ON  一个例子:cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..
      

  5.   

    使用 opencv/platforms/ios/build_framework.py 编译的opencv2.framework 
    我在build_framework.py里面cmake_flags.append("-DCMAKE_C_FLAGS=-fembed-bitcode")
                    cmake_flags.append("-DCMAKE_CXX_FLAGS=-fembed-bitcode")
                    cmake_flags.append("-WITH_GTK=ON")
    编译之后还是没有解决问题,求高人指教
      

  6.   


    你报的错误就是gtk缺失啊。加上:"-DWITH_GTK=ON"
      

  7.   


    你报的错误就是gtk缺失啊。加上:"-DWITH_GTK=ON"
    还是没解决问题