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. Windows OpenGL Linking problem?
QtWS25 Last Chance

Windows OpenGL Linking problem?

Scheduled Pinned Locked Moved Unsolved General and Desktop
opengl5.9windows
9 Posts 3 Posters 3.4k Views
  • 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.
  • S Offline
    S Offline
    silvano.cerza
    wrote on 12 Jun 2017, 09:47 last edited by
    #1

    I'm trying to build an application that uses OpenGL on Windows with Qt 5.9 and MSVC 2017.
    Problem is that it fails at build time since it can't find lots of external symbols like glBindBuffer , glDeleteBuffers and lots of other OpenGL functions, this makes me think that is not linking to correct version of OpenGL. How could I make it link to correct version?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      m.sue
      wrote on 12 Jun 2017, 11:29 last edited by
      #2

      Hi,

      if you work with qmake .pro files you will probably just have to add LIBS += -lopengl32.

      -Michael.

      S 1 Reply Last reply 12 Jun 2017, 12:31
      0
      • M m.sue
        12 Jun 2017, 11:29

        Hi,

        if you work with qmake .pro files you will probably just have to add LIBS += -lopengl32.

        -Michael.

        S Offline
        S Offline
        silvano.cerza
        wrote on 12 Jun 2017, 12:31 last edited by
        #3

        @m.sue Doesn't work, it links the system library and it's too old since it's version 1.1.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          m.sue
          wrote on 12 Jun 2017, 12:49 last edited by
          #4

          Hi,

          that can mean that

          • you do not have the driver of your graphic card installed (properly), which would overwrite system-library, or
          • you use angle, or
          • you use software rendering.

          What is it that you use?

          -Michael.

          S 1 Reply Last reply 12 Jun 2017, 14:44
          0
          • M m.sue
            12 Jun 2017, 12:49

            Hi,

            that can mean that

            • you do not have the driver of your graphic card installed (properly), which would overwrite system-library, or
            • you use angle, or
            • you use software rendering.

            What is it that you use?

            -Michael.

            S Offline
            S Offline
            silvano.cerza
            wrote on 12 Jun 2017, 14:44 last edited by
            #5

            @m.sue GPU drivers are updated to latest version, using an Nvidia GeForce GTX 970, driver version is 369.09.
            I don't think I'm using Angle nor software rendering. How can I be sure that it's not using those though?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on 12 Jun 2017, 15:37 last edited by Chris Kawa 6 Dec 2017, 15:39
              #6

              glBindBuffer is a function of OpenGL >= 2.0, which means it is resolved dynamically at runtime. It should not be linked at all.
              Qt resolves these functions and exposes them through QOpenGLFunctions. Are you using that class or trying to call them directly?

              If you're using the prebuilt binaries then Angle/Desktop selection happens at runtime. If your app is not even linking then you're still way away from that point.

              S 1 Reply Last reply 12 Jun 2017, 15:56
              1
              • C Chris Kawa
                12 Jun 2017, 15:37

                glBindBuffer is a function of OpenGL >= 2.0, which means it is resolved dynamically at runtime. It should not be linked at all.
                Qt resolves these functions and exposes them through QOpenGLFunctions. Are you using that class or trying to call them directly?

                If you're using the prebuilt binaries then Angle/Desktop selection happens at runtime. If your app is not even linking then you're still way away from that point.

                S Offline
                S Offline
                silvano.cerza
                wrote on 12 Jun 2017, 15:56 last edited by
                #7

                @Chris-Kawa I'm using a third party library, QNanoPainter, which uses NanoVG as rendering backend, from my understanding it uses QOpenGLFunctions. I should have said that in first post I think.

                I'm using the precompiled binaries.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  silvano.cerza
                  wrote on 13 Jun 2017, 08:31 last edited by
                  #8

                  I was wrong, it doesn't use QOpenGLFunctions, NanoVG makes raw OpenGL calls.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on 13 Jun 2017, 13:53 last edited by
                    #9

                    Right, the library doesn't seem to be very Windows friendly. It assumes the pointers to GL functions resolved and available in global scope, which is not how it usually works on this platform. Moreover it seems to force ANGLE and OpenGL ES (or at least tries to) on Windows in the .pri file, but then is inconsistent in how it checks for that.

                    I'd say contact the authors and ask them to fix the Windows parts.

                    1 Reply Last reply
                    1

                    5/9

                    12 Jun 2017, 14:44

                    • Login

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