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

GlActiveTexture() linker error with Qt5



  • Hey guys,

    I have a problem using glActiveTexture() in Qt5.0.1 Windows. It's the self compiled desktop OpenGL version. I get the following linker error:
    @Texture.obj:-1: Error:LNK2019: unresolved external symbol "_glActiveTexture" in function ""protected: void __thiscall Texture::textureInit(void)" (?textureInitatTextureatatIAEXXZ)".@

    These are my includes:
    @
    #define GL_GLEXT_PROTOTYPES

    #include <QtOpenGL>

    #if defined(_WIN32)
    #include <gl/GLU.h>
    #endif
    @

    Other texture functions like glBindTexture() work flawlessly.

    Does anyone have an idea how to fix this?

    Thanks in advance!

    obab



  • Hi obab,

    I got the same problem some time ago and i solved it like this (I am also using the desktop openGL version):

    Instead of using directly
    @
    glActiveTexture(GL_TEXTURE0);
    @

    u do smth like that
    @
    QOpenGLFunctions f(yourQOpenGLContextInstance);
    f.glActiveTexture(GL_TEXTURE0);
    @

    Works perfectly in my case!

    Greetings


Log in to reply