2

我正在尝试在 Fedora17 上运行 openCV 的教程代码。我按照 openCV 安装包附带的内部教程中的说明安装了它。这是代码。

#include <cv.h>
#include <highgui.h>
using namespace cv;
int main( int argc, char** argv )
{
Mat image;
image = imread( argv[1], 1 );
if( argc != 2 || !image.data )
{
printf( "No image data \n" );
return -1;
}
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", image );
waitKey(0);
return 0;
}

我收到有关 GTK 的错误,这是我收到的错误。

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/erogol/Desktop/OpenCV-2.4.3/modules/highgui/src/window.cpp, line 602
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/erogol/Desktop/OpenCV-2.4.3/modules/highgui/src/window.cpp:602: 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

Aborted (core dumped)

您对问题有解决方案或建议吗?

4

0 回答 0