PDA

View Full Version : Qt 5.0.1 + Visual Studio 2012 + OpenGL Error



Rayven
19th April 2013, 18:21
I am trying to convert my Qt4 project to Qt5. It uses OpenGL and works fine on 2008/Qt4.8.4. Please note, that I am retyping in the errors listed and not copying pasting and full code is NOT available.

- I have recompiled Qt 5.0.1 (sucessfully) using the "-opengl desktop" flag
- Installed the Visual Studio 2012 Add-in

When I compile my code I get the following error:


1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\GL/gl.h(60): error C2371: 'GLdouble' : redefinition; different basic types
1> c:\qt\qt-everywhere-opensource-src-5.0.1\qtbase\include\qtgui\../../src/gui/opengl/qopengl.h(71) : see declaration of 'GLdouble'

if I replace the
#include <GL/gl.h> with
#include <qopengl.h> or
#include <qgl.h> I get GL_PROJECTION macro not found errors and the redefinition errors are gone. I "should" not be using the OpenGL ES due to the -opengl desktop flag. Any help would be GREATLY appricated!

[EDITED:] Also, this is using a QGLWidget and not QWindow.

Rayven
19th April 2013, 20:53
I am rebuilding 5.0.1 right now. When I built 5.0.1 I used -loadconfig, but it seems it did not take any of the flags, but built with defaults instead. I went back into the the configure output and ANGLE was still being used despite the -opengl desktop being passed in. I am rebuilding directly typing in the command flags. Also, it seems that 5.0.2 may have also fixed some of the OpenGL ES issues, so I will try and built with 5.0.2 as well.

http://stackoverflow.com/questions/16110134/qt-5-0-1-visual-studio-2012-opengl

Rayven
24th April 2013, 18:34
In short: for Visual Studio 2012 is to use/build Qt 5.0.2 and disable angle (-no-angle) AND use -opengl desktop.