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
Forum Updated to NodeBB v4.3 + New Features

Linker error when using OpenGL on windows

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 734 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 12 Jun 2022, 18:30 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Jun 2022, 18:32 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 12 Jun 2022, 20:43 last edited by tamirmichael 6 Dec 2022, 20:49
        #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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Jun 2022, 21:10 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 13 Jun 2022, 18:07
          0
          • S SGaist
            12 Jun 2022, 21:10

            From the looks of it, I would say yes.

            T Offline
            T Offline
            tamirmichael
            wrote on 13 Jun 2022, 18:07 last edited by
            #5

            @SGaist Thanks.

            1 Reply Last reply
            0

            1/5

            12 Jun 2022, 18:30

            • Login

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