Skip to content

highgui: Compilation error with Qt5 due to #ifdef Q_WS_X11 guard #6471

@marv

Description

@marv

I get the following compilation error when building against Qt5:

/var/tmp/paludis/build/media-libs-opencv-3.1.0-r2/work/opencv-3.1.0/modules/highgui/src/window_QT.cpp: In member function 'virtual void OpenGlViewPort::initializeGL()':
/var/tmp/paludis/build/media-libs-opencv-3.1.0-r2/work/opencv-3.1.0/modules/highgui/src/window_QT.cpp:3168:12: error: 'GL_PERSPECTIVE_CORRECTION_HINT' was not declared in this scope
     glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
            ^
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:104: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o' failed

This is caused by the #ifdef Q_WS_X11 guard around the #include <GL/glx.h> which is no longer defined by Qt5. Qt5 now defines Q_OS_* constants.

I would provide a fix, but I'm not certain whether to use Q_OS_UNIX or Q_OS_LINUX here

Full build log:
1461600198-install-media-libs_opencv-3.1.0-r2:0::media.out.txt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions