Important: Please read the Qt Code of Conduct -

GLDEBUGPROC symbol not defined

  • Hello everybody
    I'm trying to compile a project using Qt 5.11 on a Mac with Mac OS High Sierra v. 10.13.
    In one of my header file I include

    #include <QOpenGLContext>

    While compiling with clang_64 I got the following error:

    In file included from /Library/Qt/5.11/5.11.1/clang_64/lib/QtGui.framework/Headers/QOpenGLContext:1:
    In file included from /Library/Qt/5.11/5.11.1/clang_64/lib/QtGui.framework/Headers/qopenglcontext.h:61:
    /Library/Qt/5.11/5.11.1/clang_64/lib/QtGui.framework/Headers/qopenglversionfunctions.h:1089:23: error: unknown type name 'GLDEBUGPROC'

    I saw that this symbol is defined inside the file qopenglext.h. I tried to include it before QOpenGLContext but nothing changed.

    Actually the only way to avoid this error is to manually define the symbol on my header

    typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);

    #include <QOpenGLContext>

    This way everything compiles fine.

    Note that the same code (without the manual typedef) compile perfectly under Windows 10 with Visual Studio 2017 compiler.

    Thanks in advance

  • Moderators

    Hi @marco-beninca71,

    I have not seen this personally and I am using XCode 9.4 on macOS 10.13. Which version of XCode are you using here? Can you provide a minimal example to reproduce this?

  • Hi @AndyS
    trying to recreate the issue on a small project I found out that it was a matter of includes sequence. Putting <QOpenGLContext> as first include everything works fine. In my original project I have many libraries involved with a lot of boost and Qt includes inside precompiled headers. So I didn't investigate deeply which is the include generating the issue.
    Thanks for your help

  • Moderators

    HI @marco-beninca71,

    I am glad it is solved. The trick is to always include Qt includes first, so it could have been just a case of that. Can you mark this as solved as this is solved for you now?

Log in to reply