Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highgui/window_QT.cpp erroneously includes glx.h on GLES plattforms #9171

Closed
StefanBruens opened this issue Jul 16, 2017 · 2 comments
Closed
Assignees
Labels
bug category: build/install Hackathon https://opencv.org/opencv-hackathon-starts-next-week/
Milestone

Comments

@StefanBruens
Copy link
Contributor

System information (version)
  • OpenCV => 3.2
  • Operating System / Platform => Linux
  • Compiler => GCC7
Detailed description

After
3bf16da, which
adresses #6471,

GL/glx.h is included on all LINUX plattforms, which is wrong for a number of reasons:

  • GL_PERSPECTIVE_CORRECTION_HINT is defined in GL/gl.h, not glx.h, the latter just includes the former
  • GL/gl.h is a Desktop GL header, and should not be included on GLES plattforms
  • GL/gl.h is already included via QtOpenGL -> QtGui/qopengl.h on desktop plattforms

Including both GLES and GL headers leads to compilation errors on 32bit GLES plattforms, as it causes
conflicting type declarations:

[  729s] In file included from /usr/include/GL/gl.h:2060:0,
[  729s]                  from /usr/include/GL/glx.h:32,
[  729s]                  from /home/abuild/rpmbuild/BUILD/opencv-3.2.0/modules/highgui/src/window_QT.cpp:59:
[  729s] /usr/include/GL/glext.h:468:19: error: conflicting declaration 'typedef ptrdiff_t GLsizeiptr'
[  729s]  typedef ptrdiff_t GLsizeiptr;
[  729s]                    ^~~~~~~~~~
[  729s] In file included from /usr/include/qt5/QtGui/qopengl.h:107:0,
[  729s]                  from /usr/include/qt5/QtGui/QtGui:43,
[  729s]                  from /usr/include/qt5/QtOpenGL/QtOpenGLDepends:4,
[  729s]                  from /usr/include/qt5/QtOpenGL/QtOpenGL:3,
[  729s]                  from /home/abuild/rpmbuild/BUILD/opencv-3.2.0/modules/highgui/src/window_QT.h:46,
[  729s]                  from /home/abuild/rpmbuild/BUILD/opencv-3.2.0/modules/highgui/src/window_QT.cpp:47:
[  729s] /usr/include/GLES3/gl3.h:73:25: note: previous declaration as 'typedef khronos_ssize_t GLsizeiptr'
[  729s]  typedef khronos_ssize_t GLsizeiptr;

GL_PERSPECTIVE_CORRECTION_HINT does not exist in GLES 2.0/3.x, and has been deprecated in OpenGL 3.0 core profiles.

Steps to reproduce
StefanBruens added a commit to StefanBruens/opencv that referenced this issue Feb 2, 2020
GL/glx.h is included on all LINUX plattforms, which is wrong
for a number of reasons:

- GL_PERSPECTIVE_CORRECTION_HINT is defined in GL/gl.h, so we
  want gl.h not glx.h, the latter just includes the former
- GL/gl.h is a Desktop GL header, and should not be included
  on GLES plattforms
- GL/gl.h is already included via QtOpenGL ->
  QtGui/qopengl.h on desktop plattforms

This fixes a problem when Qt is compiled with GLES, which
is often done on ARM platforms where desktop GL is not or
only poorly supported (e.g. slow due to emulation).

Fixes part of opencv#9171.
StefanBruens added a commit to StefanBruens/opencv that referenced this issue Feb 2, 2020
GL_PERSPECTIVE_CORRECTION_HINT does not exist in GLES 2.0/3.x,
and has been deprecated in OpenGL 3.0 core profiles.

Fixes part of opencv#9171.
@vpisarev
Copy link
Contributor

vpisarev commented Feb 3, 2020

@alalek, @StefanBruens, should we close it?

@StefanBruens
Copy link
Contributor Author

With the two patches merged it should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: build/install Hackathon https://opencv.org/opencv-hackathon-starts-next-week/
Projects
None yet
Development

No branches or pull requests

4 participants