Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Cannot build 5.0 Beta2 project using OpenGL
Qt 6.11 is out! See what's new in the release blog

[Solved] Cannot build 5.0 Beta2 project using OpenGL

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 3 Posters 4.5k 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.
  • E Offline
    E Offline
    electrohamster
    wrote on last edited by
    #1

    Repost from http://qt-project.org/forums/viewthread/22479/
    Realized "Installation and Deployment" is the correct category

    I’ve tried everything (….well clearly not everything or it would be working) but I cannot get a 5.0 beta project that uses opengl to compile on Windows 7.

    I have “QT += core gui opengl widgets” in my pro file so the Qt OpenGL module should be available

    #include <QtOpenGL> is present. However, I get all sorts of compile errors like
    “‘GL_MODELVIEW’ : undeclared identifier”
    “‘glMatrixMode’: identifier not found”

    I THINK I have added the proper PATH, Include, and Lib variables pointing to the right folders, but at this point I'm not sure anymore.

    Clearly an opengl library somewhere isn’t being included properly but its driving me nuts which it is. I shouldn’t have to download opengl separately, right? Isn’t it included as part of Qt?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Qt5 uses Angle by default. You need to compile it yourself if you want to use OpenGL. OpenGL headers are not included with Qt, and you need to have a proper driver on your machine.

      (Z(:^

      1 Reply Last reply
      0
      • E Offline
        E Offline
        electrohamster
        wrote on last edited by
        #3

        I'm currently trying to build QT5 from scratch (4 hr build and stuff keeps going wrong, life is misery) but could you clarify / correct me if I'm wrong?

        1. When you say build it yourself you mean Qt5 per http://qt-project.org/wiki/Building_Qt_5_from_Git , correct?

        2. I want to build an exe that runs fine on any win machine. I assume compiling with -opengl locks your executables in with either Nvidia or ATI? Should I be using angle?

        3. Stupid question, but what headers should I be including? When I try I keep getting macro redefinition errors such as glFloat.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Yes, correct.

          Probably not, OpenGL is platform-agnostic to a lage degree. Then again, angle is default for a reason.

          No idea, sorry. I do most of my coding on Linux, and here everything with regard to OpenGL just works. Make sure you do have your AMD/ Nvidia/ Intel drivers installed. Stock Windows includes OpenGL 1.1 only, Qt requires OpenGL 2.0.

          (Z(:^

          1 Reply Last reply
          0
          • E Offline
            E Offline
            electrohamster
            wrote on last edited by
            #5

            I've solved the problem and feel very ashamed of my fail....

            OpenGl uses AngleProject which works fine, however, Angle doesn't include Glut support which you'll need to add yourself.

            1. download glut.h AND its accompanying glut32.lib from the internet. Depending on where you save them make sure to add their paths to the "INCLUDE" and "LIB" system variables in Projects Tab->Build Environment

            2. add #include "glut.h" to your code

            3. In Qt Creator right click your project in the projects window and select "Add Library" Chose "External library" (System Library is probably cleaner, but I'll let you add glut.h to your system if you choose). Browse to the library file AND make sure that the Include path is correct. DO NOT trust Qt Creator to auto complete the Include Path. I didn't look at it and QT Creator auto completed the wrong path, took me 30 min to realize that was messing up my linker.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              srav219
              wrote on last edited by
              #6

              I am also facing the same build issue with the latest qt5 source code when configuring the build with -no-opengl option.
              Is there any soft fix to build it.
              My requirement is I need only qtquick1,I dont need qtquick2.Is there a way to enable only qtquick1 only.if yes,Please let me know

              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