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

Link errors when using GLU functions with qt msvc2010 opengl 5.2.1 binary package



  • Hi,

    I am using various glu functions in a Qt application. I get the following link errors when building it against the qt-opensource-windows-x86-msvc2010-opengl-5.2.1 binary package installation.

    @
    ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluErrorString referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluDeleteTess referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessEndPolygon referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessEndContour referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessVertex referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessBeginContour referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessBeginPolygon referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessCallback referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluTessProperty referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluGetTessProperty referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluNewTess referenced in function ...
    RCOpenGL.obj : error LNK2019: unresolved external symbol _gluBuild2DMipmaps referenced in function ...
    ...
    @

    I don't get these errors when I build the same code with the qt-opensource-windows-x86-msvc2012_64-opengl-5.2.1 binary installation or when I use the equivalent on a Mac with OS X.

    What is the difference here? I would like to get it to build on windows 32 bit as well as 64 bit.

    I will be very grateful for any suggestions as to how to fix this.

    Many thanks.



  • You will need to link to the GLU library manually. It's separate from the actual OpenGL library, but it may be linked implicitly on some platforms. You should keep in mind that GLU has been deprecated for quite a long time. It isn't really the recommended way to do anything at this point. (Though admittedly doing stuff like tesselations on the GPU using modern API's is probably going to be less convenient.)



  • Thank you for your reply,

    I can't stop using the GLU just yet so I must make it work for now.

    I will add the linking stuff to my pro file and see how it goes.

    Thanks again.


Log in to reply