Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

GLvoid does not name a type



  • error: ‘GLvoid’ does not name a type ???



  • /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:131:1: error: expected class-name before ‘{’ token
    {
    ^
    /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:135:5: error: ‘GLvoid’ does not name a type
    GLvoid* (QOPENGLF_APIENTRYP MapBuffer)(GLenum target, GLenum access);
    ^
    /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:136:16: error: ‘QOPENGLF_APIENTRYP’ has not been declared
    GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
    ^
    /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:136:48: error: ‘GLenum’ has not been declared
    GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
    ^
    /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:136:61: error: ISO C++ forbids declaration of ‘GLboolean’ with no type [-fpermissive]
    GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please don't highjack other people thread with completely unrelated questions. I've created one for your question.

    From your error it looks like you don't have the OpenGL development package for your distribution installed.

    Also note that Qt 5.2.0 is pretty outdated, the current version is 5.8.0.

    One last thing, developing as root is really a bad idea, if you do anything wrong, there won't be any warning or stopping measure so you can brick your system pretty easily.



  • thanks i come from china ,build qt just 2 days



  • @SGaist :184:116: error: ‘GLvoid’ was not declared in this scope
    /root/downSource/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtGui/5.2.0/QtGui/private/../../../../../src/gui/opengl/qopenglextensions_p.h:184:124: error: ‘data’ was not declared in this scope
    In file included from ../../../../include/QtQuick/5.2.0/QtQuick/private/qsgdepthstencilbuffer_p.h:1:0,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgcontext_p.h:55,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qsgcontext_p.h:1,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickwindow_p.h:59,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickitem_p.h:62,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickitem_p.h:1,
    from qquickviewinspector.cpp:49:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h:92:5: error: ‘GLuint’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h:93:5: error: ‘GLuint’ does not name a type
    In file included from ../../../../include/QtQuick/5.2.0/QtQuick/private/qsgcontext_p.h:1:0,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickwindow_p.h:59,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickitem_p.h:62,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickitem_p.h:1,
    from qquickviewinspector.cpp:49:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgcontext_p.h:96:57: error: ‘GLuint’ has not been declared
    In file included from ../../../../include/QtQuick/5.2.0/QtQuick/private/qsgadaptationlayer_p.h:1:0,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:47,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickshadereffectsource_p.h:1,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickitem_p.h:81,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickitem_p.h:1,
    from qquickviewinspector.cpp:49:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:180:9: error: ‘GLuint’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:243:24: error: ‘GLuint’ has not been declared
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:243:39: error: ‘GLuint’ has not been declared
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:246:5: error: ‘GLuint’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h: In constructor ‘QSGDistanceFieldGlyphCache::Texture::Texture()’:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:183:21: error: class ‘QSGDistanceFieldGlyphCache::Texture’ does not have any field named ‘textureId’
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h: In member function ‘bool QSGDistanceFieldGlyphCache::Texture::operator==(const QSGDistanceFieldGlyphCache::Texture&) const’:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:184:64: error: ‘textureId’ was not declared in this scope
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgadaptationlayer_p.h:184:83: error: ‘const struct QSGDistanceFieldGlyphCache::Texture’ has no member named ‘textureId’
    In file included from ../../../../include/QtQuick/qsgmaterial.h:1:0,
    from ../../../../include/QtQuick/../../src/quick/scenegraph/util/qsgtexturematerial.h:45,
    from ../../../../include/QtQuick/qsgtexturematerial.h:1,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/scenegraph/qsgdefaultimagenode_p.h:47,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qsgdefaultimagenode_p.h:1,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:49,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickshadereffectsource_p.h:1,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickitem_p.h:81,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickitem_p.h:1,
    from qquickviewinspector.cpp:49:
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h: At global scope:
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:100:12: error: ‘QOpenGLShaderProgram’ does not name a type
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:109:30: error: ‘QOpenGLShader’ has not been declared
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:109:56: error: expected ‘,’ or ‘...’ before ‘type’
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:110:31: error: ‘QOpenGLShader’ has not been declared
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:110:57: error: expected ‘,’ or ‘...’ before ‘type’
    ../../../../include/QtQuick/../../src/quick/scenegraph/coreapi/qsgmaterial.h:119:5: error: ‘QOpenGLShaderProgram’ does not name a type
    In file included from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickshadereffectsource_p.h:1:0,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickitem_p.h:81,
    from ../../../../include/QtQuick/5.2.0/QtQuick/private/qquickitem_p.h:1,
    from qquickviewinspector.cpp:49:
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:106:5: error: ‘GLenum’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:107:20: error: ‘GLenum’ has not been declared
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:136:5: error: ‘GLenum’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:143:5: error: ‘GLuint’ does not name a type
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:183:17: error: ‘GL_ALPHA’ was not declared in this scope
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:184:15: error: ‘GL_RGB’ was not declared in this scope
    ../../../../include/QtQuick/5.2.0/QtQuick/private/../../../../../src/quick/items/qquickshadereffectsource_p.h:185:16: error: ‘GL_RGBA’ was not declared in this scope
    compiling inspecttool.cpp
    make[5]: *** [.obj/qquickviewinspector.o] Error 1
    make[5]: *** Waiting for unfinished jobs....
    make[5]: Leaving directory /root/downSource/qt-everywhere-opensource-src-5.2.0/qtdeclarative/src/plugins/qmltooling/qmldbg_qtquick2' make[4]: *** [sub-qmldbg_qtquick2-make_first] Error 2 make[4]: Leaving directory/root/downSource/qt-everywhere-opensource-src-5.2.0/qtdeclarative/src/plugins/qmltooling'
    make[3]: *** [sub-qmltooling-make_first] Error 2
    make[3]: Leaving directory /root/downSource/qt-everywhere-opensource-src-5.2.0/qtdeclarative/src/plugins' make[2]: *** [sub-plugins-make_first-ordered] Error 2 make[2]: Leaving directory/root/downSource/qt-everywhere-opensource-src-5.2.0/qtdeclarative/src'
    make[1]: *** [sub-src-make_first] Error 2



  • @SGaist
    sudo apt-get install build-essential

    sudo apt-get install libgl1-mesa-dev

    sudo apt-get install libglu1-mesa-dev

    sudo apt-get install freeglut3-dev


  • Qt Champions 2019

    @The-most-recent-future Do you have to use this old Qt version?
    Current version is 5.8



  • @jsulm
    yes. version 5.2.0
    but , the error ................ can you help me??


  • Qt Champions 2019

    @The-most-recent-future Do you build for desktop or for a device?
    Also as @SGaist said you should really not develop as root - this is a very very bad idea.


  • Lifetime Qt Champion

    What exact options did you pass to configure before building Qt ?



  • @SGaist
    ./configure
    -release
    -opensource
    -qt-libpng
    -qt-zlib
    -qt-libjpeg
    -glib
    -plugin-sql-sqlite
    -qt-sql-sqlite
    -make libs
    -no-cups
    -no-nis
    -no-iconv
    -no-dbus
    -no-opengl
    -no-xcb
    -no-accessibility
    -no-javascript-jit
    -silent
    -arch arm
    -xplatform linux-arm-gnueabi-g++
    -linuxfb
    -nomake tools
    -nomake examples
    -nomake tests
    -qt-freetype
    -no-glib
    -strip
    -plugindir /root/downSource/qt-everywhere-opensource-src-5.2.0/plugins
    -confirm-license "$@" -verbose


  • Lifetime Qt Champion

    There: -no-opengl. I remember there where some problem at some point building with -no-opengl, it should have been fixed in between but I don't remember if it was prior to or after Qt 5.2.0



  • @SGaist
    Whether or not to add
    -no-egl
    -no-opengl

    these error will be show !

    @SGaist 大神,就我!!



  • @SGaist
    这个问题困扰了我好几天了,大神,你救救我吧!我都要哭了....


  • Lifetime Qt Champion

    When changing the configure options, are you doing from a clean source ? That's the first thing to do before calling configure again.

    Or better: do out of source builds, so if something goes wrong, you juste nuke the build folder and start new.



  • @SGaist
    yes , make clean && make distclean
    when i change the configure , i will be make clean and make distclean,
    but, the error will be show .


  • Lifetime Qt Champion

    What does the configuration summary show ?



  • @SGaist
    1 : make and make install

                   Looks like a success
                   data size : 108 M
                   but, why the example files  is not be generated ???


  • @SGaist

    make -j3

    compiling .moc/moc_abstractliveedittool.cpp
    compiling .moc/moc_liveselectiontool.cpp
    compiling .moc/moc_boundingrecthighlighter.cpp
    compiling .moc/moc_zoomtool.cpp
    compiling .moc/moc_colorpickertool.cpp
    compiling .moc/moc_abstracttool.cpp
    rm -f libqmldbg_inspector.so
    linking ../../../../plugins/qml1tooling/libqmldbg_inspector.so
    mv -f libqmldbg_inspector.so ../../../../plugins/qml1tooling/
    make[5]: Leaving directory /home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/src/plugins/qmltooling/qmldbg_inspector' make[4]: Leaving directory/home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/src/plugins/qmltooling'
    make[3]: Leaving directory /home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/src/plugins' make[2]: Leaving directory/home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/src'
    cd tools/ && ( test -e Makefile || /home/cc/qt-everywhere-opensource-src-5.2.0/qtbase/bin/qmake /home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/tools/tools.pro -o Makefile ) && make -f Makefile
    make[2]: Entering directory /home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/tools' make[2]: Nothing to be done forfirst'.
    make[2]: Leaving directory /home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1/tools' make[1]: Leaving directory/home/cc/qt-everywhere-opensource-src-5.2.0/qtquick1'
    cc@ubuntu:~/qt-everywhere-opensource-src-5.2.0$



  • @SGaist

    No ”example“ folder

    [root@cv_soc /usr/local/Qt-5.2.0]# ls
    bin/ imports/ lib/ qml/
    doc/ include/ mkspecs/ translations/
    [root@cv_soc /usr/local/Qt-5.2.0]#



  • @SGaist
    int .configure
    -qt-xcb

     what packages should be install ??


  • @SGaist
    Please let me know how to resolve the error.



  • @SGaist
    make: *** [xlib.o] Error 1
    XLib disabled.
    xcb auto-detection... ()
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o xcb.o xcb.cpp
    xcb.cpp:42:21: fatal error: xcb/xcb.h: No such file or directory
    #include <xcb/xcb.h>
    ^
    compilation terminated.
    make: *** [xcb.o] Error 1
    xcb disabled.
    The test for linking against libxcb failed!
    You might need to install dependency p


  • Lifetime Qt Champion

    Seems like this question is being answered here.



  • @SGaist @jsulm
    /usr/local/qt/qt-everywhere-opensource-src-5.3.2/qtbase/configure: 3181: /usr/local/qt/qt-everywhere-opensource-src-5.3.2/qtbase/configure: arm-linux-gnueabihf-gnueabi-g++: not found
    Creating qmake...
    make: Nothing to be done for 'first'.
    Running configuration tests...
    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    Linux Framebuffer support cannot be enabled due to functionality tests!
    Turn on verbose messaging (-v) to /usr/local/qt/qt-everywhere-opensource-src-5.3.2/qtbase/configure to see the final report.
    If you believe this message is in error you may use the continue
    switch (-continue) to /usr/local/qt/qt-everywhere-opensource-src-5.3.2/qtbase/configure to continue.
    ./configInstall.sh: line 8: /root: Is a directory

    how to do ? thanks.


  • Lifetime Qt Champion

    As silly as it may sound: give configure the correct options for it to find your cross-compiler.


Log in to reply