OpenCV Error: No OpenGL support (Library was built without OpenGL support). But OpenGL sample runs okay and CV was built using OpenGL.

asked 2015-06-05 01:21:50 -0500

abhiguru gravatar image

updated 2015-06-05 01:22:45 -0500

Config : OpenCV 3.0 + Ubuntu 14.04 built with CUDA + OPENGL + NVCUID. The build/cvconfig.h content can be viewed at http://pastebin.com/eZGHn4ys which confirms that OpenGL was built successfully

1) I can successfully run the sample at build/bin/gpu-example-video_reader

2) I copied the /samples/gpu/video_reader.cpp sample into a new project and am trying to run it using a CMakeLists.txt below

PROJECT( Segmenter ) FIND_PACKAGE( OpenCV REQUIRED ) ADD_EXECUTABLE( segitb segitb.cpp ) TARGET_LINK_LIBRARIES( segitb ${OpenCV_LIBS} )

I get the following error message at runtime

OpenCV Error: No OpenGL support (Library was built without OpenGL support) in cvNamedWindow, file /home/ubuntu/cv/modules/highgui/src/window_gtk.cpp, line 1048 terminate called after throwing an instance of 'cv::Exception' what(): /home/ubuntu/cv/modules/highgui/src/window_gtk.cpp:1048: error: (-218) Library was built without OpenGL support in function cvNamedWindow

Am I missing something in my CMakeLists.txt ?

edit retag flag offensive close merge delete

Comments

I am guessing that your target link libraries will also need to contain your lib files of your OpenGL installation?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-06-05 03:38:00 -0500 )edit