Linker error when using OpenGL on windows
-
Hello,
I have a program written on a Linux platform that uses a combination of QPainter method calls and native OpenGL calls, and it builds and works as expected.
In the .pro file of my project I have "LIBS += -lGLU" as well as "QT += opengl", but unfortunately when building on Windows 11 after installing OpenGL (I see "opengl32.dll" in my "Windows/System32" folder, as well as "glu32.dll") this yields the following linker error:D:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lGLU collect2.exe: error: ld returned 1 exit status
Any ideas how to address this? I looked at the examples available but they are all QOpenGLWidget based, combined with QOpenGLFunctions - so no native calls such as "glPushMatrix()" etc. are used there.
Thanks in advance.
-
Hi,
You need to install a matching MinGW compiled GLU library on your Windows machine.
-
Hi,
Thanks for your reply.
I guess I need to follow these instructions then:
https://medium.com/@bhargav.chippada/how-to-setup-opengl-on-mingw-w64-in-windows-10-64-bits-b77f350cea7e -
From the looks of it, I would say yes.
-
@SGaist Thanks.