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

Windows OpenGL Linking problem?

Scheduled Pinned Locked Moved Unsolved General and Desktop
opengl5.9windows
9 Posts 3 Posters 3.6k 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.
  • S Offline
    S Offline
    silvano.cerza
    wrote on 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.sueM Offline
      m.sueM Offline
      m.sue
      wrote on 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
      0
      • m.sueM m.sue

        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 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.sueM Offline
          m.sueM Offline
          m.sue
          wrote on 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
          0
          • m.sueM m.sue

            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 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
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by Chris Kawa
              #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
              1
              • Chris KawaC Chris Kawa

                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 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 last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • Chris KawaC Offline
                    Chris KawaC Offline
                    Chris Kawa
                    Lifetime Qt Champion
                    wrote on 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

                    • Login

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