0

I have Debian installed on my WSL2, running VcXsrv, but cannot get opencv to display image. I have both libgtk2.0-dev and pkg-config installed. When I try to use imshow, I get the following error

terminate called after throwing an instance of 'cv::Exception'

what(): OpenCV(4.5.1-dev) /home/scs/opencv/modules/highgui/src/window.cpp:679: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'

  • "then re-run cmake" did you do that? To be clear, it's OpenCV itself you must rebuild (cmake, make, make install), not just your project. – m88 Feb 10 '21 at 14:11
  • yes I rebuilt cmake after installing libgtk2.0-dev and pkg-config, still the same error – user3443627 Feb 10 '21 at 14:13
  • Well, you were right, I have done something wrong before. When I deleted the whole build directory of opencv and rebuilt it all again, it works. – user3443627 Feb 10 '21 at 14:33

0 Answers0