Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linker error when using OpenGL on windows
Qt 6.11 is out! See what's new in the release blog

Linker error when using OpenGL on windows

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tamirmichael
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to install a matching MinGW compiled GLU library on your Windows machine.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • T Offline
        T Offline
        tamirmichael
        wrote on last edited by tamirmichael
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          From the looks of it, I would say yes.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          T 1 Reply Last reply
          0
          • SGaistS SGaist

            From the looks of it, I would say yes.

            T Offline
            T Offline
            tamirmichael
            wrote on last edited by
            #5

            @SGaist Thanks.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved