OpenCV samples not compiling

I tried to run a sample in OpenCV so I can get more familiar with it, and get the following errors:

ubuntu@tegra-ubuntu:~/opencv-2.4.9/samples/gpu$ g++ houghlines.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -o houghlines
ubuntu@tegra-ubuntu:~/opencv-2.4.9/samples/gpu$ ./houghlines …/cpp/logo_in_clutter.png
CPU Time : 143.479 ms
CPU Found : 39
GPU Time : 135.457 ms
GPU Found : 199
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 cvShowImage, file /hdd/buildbot/slaves/slave_jetson_tk1/52-O4T-L4T/opencv/modules/highgui/src/window.cpp, line 501
terminate called after throwing an instance of ‘cv::Exception’
what(): /hdd/buildbot/slaves/slave_jetson_tk1/52-O4T-L4T/opencv/modules/highgui/src/window.cpp:501: 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 cvShowImage

Aborted

Not sure why it wont run. I am using a Jetson board

I just had the same problem.
I finally installed CUDA 6.0 and opencv4tegra 2.4.8.2.
After 2 days got it working :)

If someone can help how to get newer version to work…I would be intrested.

Hi,

Please try to follow the steps given in the following blog to install opencv4tegra 2.4.10 and also the public opencv 2.4.9 with cuda 6.5 accelerations enabled.

You can change between the libraries during linking your application.

http://www.e-consystems.com/blog/camera/?p=1297

The custom built version has support for gtk-2.0 enabled. So it should work for you. Please post back your reply after testing.

Hi,
follow http://www.e-consystems.com/blog/camera/?p=1297
and I get the same error :(
I am using opencv4tegra 2.4.10 , public opencv 2.4.9 with cuda 6.5 accelerations.
Could I know how to get source of opencv4tegra 2.4.8.2?
I can’t find the source :((
Thx a lot

opencv4tegra source code is not available to the public. It is customized specifically for tegra and proprietary to nvidia.

It is strange that imshow is not working for you. It works fine for me. Can you send the output that is printed after you do cmake or ccmake configure and generate?

As a workaround, in houghlines.cpp try removing the function imshow and use imwrite to save the images in jpg or png formats.