Qt6 missing typedefs for primitive types
-
Greetings,
I try to build a Qt6 application on an Ubuntu 22.04 Desktop system according to this:
https://doc.qt.io/qt-6/qopenglwidget.html
But I get undefined errors:
In file included from /usr/include/x86_64-linux-gnu/qt6/QtGui/qopengl.h:146,
from /usr/include/x86_64-linux-gnu/qt6/QtOpenGLWidgets/qopenglwidget.h:47,
from /usr/include/x86_64-linux-gnu/qt6/QtOpenGLWidgets/QOpenGLWidget:1,
<ourinternalfiles>
/usr/include/x86_64-linux-gnu/qt6/QtGui/qopenglext.h:235:67: error: ‘GLdouble’ has not been declared
235 | typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);Same for other type like GLshort etc.
Any idea what that might be?
Regards
-
@Christian-Ehrlicher That's why I'm asking.
As far as I can tell the widget depends on qopengl.h which depends on QT_FEATURE_opengles3=ON to include the headers:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/opengl/qopengl.h#n42
I assume QT_FEATURE_opengles3 is only intended for compiling qt not for the client application, is it?
@Desperado17 correct. You have to compile Qt accordingly.
-
Greetings,
I try to build a Qt6 application on an Ubuntu 22.04 Desktop system according to this:
https://doc.qt.io/qt-6/qopenglwidget.html
But I get undefined errors:
In file included from /usr/include/x86_64-linux-gnu/qt6/QtGui/qopengl.h:146,
from /usr/include/x86_64-linux-gnu/qt6/QtOpenGLWidgets/qopenglwidget.h:47,
from /usr/include/x86_64-linux-gnu/qt6/QtOpenGLWidgets/QOpenGLWidget:1,
<ourinternalfiles>
/usr/include/x86_64-linux-gnu/qt6/QtGui/qopenglext.h:235:67: error: ‘GLdouble’ has not been declared
235 | typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);Same for other type like GLshort etc.
Any idea what that might be?
Regards
@Desperado17 you are likely missing OpenGL dev package. Try installing something like
mesa-common-dev
or some similar package. -
@Desperado17 you are likely missing OpenGL dev package. Try installing something like
mesa-common-dev
or some similar package.@sierdzio So far I tried adding libgl1-mesa-dev, libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev mesa-common-dev libxcb-glx0-dev, freeglut3-dev
Not enough.
-
@sierdzio So far I tried adding libgl1-mesa-dev, libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev mesa-common-dev libxcb-glx0-dev, freeglut3-dev
Not enough.
@Desperado17 Some more info: I try to combine Qt with Magnum https://github.com/mosra/magnum and the whole application is configured for OpenGL ES. It seems that Qt still pulls the desktop GL headers while Magnum pulls the lightweight GLES headers.
Is there any way to configure Qt for desktop so that it only pulls GLES headers?
-
@Desperado17 Some more info: I try to combine Qt with Magnum https://github.com/mosra/magnum and the whole application is configured for OpenGL ES. It seems that Qt still pulls the desktop GL headers while Magnum pulls the lightweight GLES headers.
Is there any way to configure Qt for desktop so that it only pulls GLES headers?
@Desperado17 said in Qt6 missing typedefs for primitive types:
Is there any way to configure Qt for desktop so that it only pulls GLES headers?
Yes.
In Qt 5, you have to compile Qt yourself and specify correct open gl version.
In Qt 6 I am not entirely sure. It should be dynamic, settable by QRhi but I am not sure if this applies to QOpenGLWidget. Perhaps it will be enough to call https://doc.qt.io/qt-6/qsurfaceformat.html#setDefaultFormat
-
@Desperado17 said in Qt6 missing typedefs for primitive types:
Is there any way to configure Qt for desktop so that it only pulls GLES headers?
Yes.
In Qt 5, you have to compile Qt yourself and specify correct open gl version.
In Qt 6 I am not entirely sure. It should be dynamic, settable by QRhi but I am not sure if this applies to QOpenGLWidget. Perhaps it will be enough to call https://doc.qt.io/qt-6/qsurfaceformat.html#setDefaultFormat
@sierdzio Will QSurfaceFormat::setDefaultFormat influence the headers pulled?
-
@sierdzio Will QSurfaceFormat::setDefaultFormat influence the headers pulled?
@Desperado17 said in Qt6 missing typedefs for primitive types:
QSurfaceFormat::setDefaultFormat influence the headers pulled?
No, how should it?
-
@Desperado17 said in Qt6 missing typedefs for primitive types:
QSurfaceFormat::setDefaultFormat influence the headers pulled?
No, how should it?
@Christian-Ehrlicher That's why I'm asking.
As far as I can tell the widget depends on qopengl.h which depends on QT_FEATURE_opengles3=ON to include the headers:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/opengl/qopengl.h#n42
I assume QT_FEATURE_opengles3 is only intended for compiling qt not for the client application, is it?
-
@Christian-Ehrlicher That's why I'm asking.
As far as I can tell the widget depends on qopengl.h which depends on QT_FEATURE_opengles3=ON to include the headers:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/opengl/qopengl.h#n42
I assume QT_FEATURE_opengles3 is only intended for compiling qt not for the client application, is it?
@Desperado17 correct. You have to compile Qt accordingly.
-