Qt5 missing opengl identifier's



  • i try to compile simple Qt application and port it to Qt5
    in the pro file i included the opengl flag :

    @ QT += opengl widgets @

    also the opengl Qt5 path is included :

    @ ................\Qt\Qt5.0.1\5.0.1\msvc2010\include\QtOpenGL
    @
    but when i compile the app im getting those compilation errors

    @ 1>qmpwidget.cpp(148): error C3861: 'glClearDepth': identifier not found
    1>qmpwidget.cpp(159): error C3861: 'glLoadIdentity': identifier not found
    1>qmpwidget.cpp(167): error C2065: 'GL_QUADS' : undeclared identifier
    1>qmpwidget.cpp(167): error C3861: 'glBegin': identifier not found
    1>qmpwidget.cpp(168): error C3861: 'glTexCoord2f': identifier not found
    1>qmpwidget.cpp(168): error C3861: 'glVertex2f': identifier not found
    1>qmpwidget.cpp(169): error C3861: 'glTexCoord2f': identifier not found
    1>qmpwidget.cpp(169): error C3861: 'glVertex2f': identifier not found
    1>qmpwidget.cpp(170): error C3861: 'glTexCoord2f': identifier not found
    1>qmpwidget.cpp(170): error C3861: 'glVertex2f': identifier not found
    1>qmpwidget.cpp(171): error C3861: 'glTexCoord2f': identifier not found
    1>qmpwidget.cpp(171): error C3861: 'glVertex2f': identifier not found
    1>qmpwidget.cpp(172): error C3861: 'glEnd': identifier not found

    @
    other opengl command do recognazied
    what im missing here ?


  • Moderators

    Only the OpenGL ES 2.0 subset is supported, which, among others, means no fixed pipeline functions. If you can stick with VBOs and shaders.



  • That's not strictly true. The version of OpenGL supported depends upon whether your Qt was built against ANGLE (OpenGL ES 2) or desktop OpenGL.

    Try one of the Qt5.1 beta1 installers that include OpenGL in the package name to get a desktop OpenGL build of Qt.


  • Moderators

    Wasn't there a problem that even the non-ANGLE builds leave out the fixed pipeline stuff from headers?
    I think I saw a topic on it somewhere on the forum.
    But I might be wrong, I haven't really tried it.



  • Nope. For desktop OpenGL builds qopengl.h includes the system GL/gl.h and an up to date equivalent of glext.h from Khronos. Whether the fixed function pipeline is available or not depends upon the version and profile of OpenGL you request. If you ask for an OpenGL 3.2 Core profile then of course the fixed function stuff won't be available. If you ask for a compatibility profile then as long as the system can provide it you will have access to the legacy fixed function stuff.


  • Moderators

    Ahh, ok. Thanks for clarifying that.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.