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. GL/gl.h and GL library
QtWS25 Last Chance

GL/gl.h and GL library

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 5 Posters 7.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.
  • U Offline
    U Offline
    ugstudent
    wrote on 26 Aug 2020, 19:36 last edited by
    #1

    Hello, I am trying to use the Qt Creator (qt 5.12.3 running on Linux CentOS 7) software to run some code and I get an error saying

    GL/gl.h: No such file or directory
    

    This happens even for the examples provided by Qt.

    Running the command

    locate GL/gl.h
    

    in terminal yields

    /home/ugstudent/Desktop/Qt_5.12.3/5.12.3/Src/qtwebengine/src/3rdparty/chromium/third_party/mesa/src/include/GL/gl.h
    /home/ugstudent/Desktop/Qt_5.12.3/GL_lib_stuff/mesa-20.1.2/include/GL/gl.h
    /home/ugstudent/Documents/mesa-20.1.2/include/GL/gl.h
    

    So the file seems to exist.

    I've tried to solve this by following various tutorials online. The instructions say to run the code

    sudo yum groupinstall "Development Tools"
    sudo yum install libGL-devel
    

    or other similar commands.
    When I run these in the terminal, I get the error

    One of the configured repositories failed (CentOS-7 - Media),
    and yum doesn't have enough cached data to continue. At this point the only
    safe thing yum can do is fail. There are a few ways to work "fix" this:
    
    1. Contact the upstream for the repository and get them to fix the problem.
    
    2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).
    
    3. Run the command with the repository temporarily disabled
    yum --disablerepo=c7-media ...
    
    4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:
    
    yum-config-manager --disable c7-media
    or
    subscription-manager repos --disable=c7-media
    
    5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:
    
    yum-config-manager --save --setopt=c7-media.skip_if_unavailable=true
    
    failure: repodata/repomd.xml from c7-media: [Errno 256] No more mirrors to try.
    file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/CentOS/repodata/repomd.xml"
    file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrecorder/repodata/repomd.xml"
    file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrom/repodata/repomd.xml"
    

    How do I fix this so that I can install the necessary libraries?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Aug 2020, 19:41 last edited by
      #2

      Hi and welcome to devnet,

      Your issue comes from the CentOS package installer. You should check with their folks.

      You can also follow the log message you got when it failed.

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

      U 1 Reply Last reply 26 Aug 2020, 20:29
      1
      • S SGaist
        26 Aug 2020, 19:41

        Hi and welcome to devnet,

        Your issue comes from the CentOS package installer. You should check with their folks.

        You can also follow the log message you got when it failed.

        U Offline
        U Offline
        ugstudent
        wrote on 26 Aug 2020, 20:29 last edited by
        #3

        I have solved the CentOS problem.

        Is there a way for me to re-install or verify the GL library because I am still getting the error

        GL/gl.h: No such file or directory
        
        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 26 Aug 2020, 20:47 last edited by
          #4

          Where is that file located on your system ?

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

          U 1 Reply Last reply 26 Aug 2020, 21:07
          0
          • S SGaist
            26 Aug 2020, 20:47

            Where is that file located on your system ?

            U Offline
            U Offline
            ugstudent
            wrote on 26 Aug 2020, 21:07 last edited by
            #5
            [ugstudent@localhost ~]$ locate GL/gl.h
            
            /home/ugstudent/Desktop/Qt_5.12.3/5.12.3/Src/qtwebengine/src/3rdparty/chromium/third_party/mesa/src/include/GL/gl.h
            /home/ugstudent/Desktop/Qt_5.12.3/GL_lib_stuff/mesa-20.1.2/include/GL/gl.h
            /home/ugstudent/Documents/mesa-20.1.2/include/GL/gl.h
            
            
            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 26 Aug 2020, 21:09 last edited by
              #6

              So in fact, you did not install the OpenGL development package on your system, did you ?

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

              U 1 Reply Last reply 26 Aug 2020, 21:18
              1
              • S SGaist
                26 Aug 2020, 21:09

                So in fact, you did not install the OpenGL development package on your system, did you ?

                U Offline
                U Offline
                ugstudent
                wrote on 26 Aug 2020, 21:18 last edited by
                #7

                I tried to verify OpenGL and got this

                [ugstudent@localhost ~]$ glxinfo | grep OpenGL
                OpenGL vendor string: VMware, Inc.
                OpenGL renderer string: llvmpipe (LLVM 7.0, 128 bits)
                OpenGL version string: 2.1 Mesa 18.3.4
                OpenGL shading language version string: 1.20
                OpenGL extensions:
                OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.3.4
                OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
                OpenGL ES profile extensions:
                
                

                If this is incorrect, how do I verify or install OpenGL?

                J S 2 Replies Last reply 27 Aug 2020, 04:38
                0
                • U ugstudent
                  26 Aug 2020, 21:18

                  I tried to verify OpenGL and got this

                  [ugstudent@localhost ~]$ glxinfo | grep OpenGL
                  OpenGL vendor string: VMware, Inc.
                  OpenGL renderer string: llvmpipe (LLVM 7.0, 128 bits)
                  OpenGL version string: 2.1 Mesa 18.3.4
                  OpenGL shading language version string: 1.20
                  OpenGL extensions:
                  OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.3.4
                  OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
                  OpenGL ES profile extensions:
                  
                  

                  If this is incorrect, how do I verify or install OpenGL?

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 27 Aug 2020, 04:38 last edited by jsulm
                  #8

                  @ugstudent "OpenGL development package".
                  Development packages usually have "-dev" package suffix, like somepackage-dev.rpm.
                  Please check this: https://doc.qt.io/qt-5/linux.html

                  sudo yum groupinstall "C Development Tools and Libraries"
                  sudo yum install mesa-libGL-devel
                  

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  U 1 Reply Last reply 27 Aug 2020, 19:54
                  4
                  • U ugstudent
                    26 Aug 2020, 21:18

                    I tried to verify OpenGL and got this

                    [ugstudent@localhost ~]$ glxinfo | grep OpenGL
                    OpenGL vendor string: VMware, Inc.
                    OpenGL renderer string: llvmpipe (LLVM 7.0, 128 bits)
                    OpenGL version string: 2.1 Mesa 18.3.4
                    OpenGL shading language version string: 1.20
                    OpenGL extensions:
                    OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.3.4
                    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
                    OpenGL ES profile extensions:
                    
                    

                    If this is incorrect, how do I verify or install OpenGL?

                    S Offline
                    S Offline
                    stretchthebits
                    wrote on 27 Aug 2020, 04:42 last edited by
                    #9

                    @ugstudent
                    OpenGL is installed on all Linuxes. You have version 2.1 and the renderer (the guys you wrote the driver) is Mesa (the Mesa project).
                    In other words, you can run programs that need OpenGL 2.1 and below.

                    For programmers:
                    In your case, you need to install the development package. I know that there are a few header files. gl.h which is the main one. glext.h if you want functions from GL 1.2 and above. glu.h (contains a few functions for rendering a sphere, cylinder and such and is very old).
                    There is also a few OS specific functions. I think on Linux, it is the glx.h file that has those functions, such as for swapping the back buffer with the front buffer.
                    There are also the project called the OpenGL wrangler (aka GLEW). This makes it easier to use GL 1.2 and above functions. What the GLEW library does is dynamically fetch addresses to GL functions.

                    You just need to figure out how to install the GL development package for your CentOS and QTCreator.

                    1 Reply Last reply
                    1
                    • J jsulm
                      27 Aug 2020, 04:38

                      @ugstudent "OpenGL development package".
                      Development packages usually have "-dev" package suffix, like somepackage-dev.rpm.
                      Please check this: https://doc.qt.io/qt-5/linux.html

                      sudo yum groupinstall "C Development Tools and Libraries"
                      sudo yum install mesa-libGL-devel
                      
                      U Offline
                      U Offline
                      ugstudent
                      wrote on 27 Aug 2020, 19:54 last edited by
                      #10

                      I tried the two commands listed.

                      Running

                      sudo yum groupinstall "C Development Tools and Libraries"
                      

                      I get

                      Warning: group C Development Tools and Libraries does not exist.
                      Error: No packages in any requested group available to install or update
                      

                      and running

                      sudo yum install mesa-libGL-devel
                      

                      I get

                      Package mesa-libGL-devel-18.3.4-7.el7_8.1.x86_64 already installed and latest version
                      Nothing to do
                      
                      J 1 Reply Last reply 28 Aug 2020, 04:57
                      0
                      • U ugstudent
                        27 Aug 2020, 19:54

                        I tried the two commands listed.

                        Running

                        sudo yum groupinstall "C Development Tools and Libraries"
                        

                        I get

                        Warning: group C Development Tools and Libraries does not exist.
                        Error: No packages in any requested group available to install or update
                        

                        and running

                        sudo yum install mesa-libGL-devel
                        

                        I get

                        Package mesa-libGL-devel-18.3.4-7.el7_8.1.x86_64 already installed and latest version
                        Nothing to do
                        
                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 28 Aug 2020, 04:57 last edited by
                        #11

                        @ugstudent Search for gl.h like this:

                        find /usr -name gl.h
                        

                        Is it there?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        U 1 Reply Last reply 28 Aug 2020, 17:30
                        2
                        • J jsulm
                          28 Aug 2020, 04:57

                          @ugstudent Search for gl.h like this:

                          find /usr -name gl.h
                          

                          Is it there?

                          U Offline
                          U Offline
                          ugstudent
                          wrote on 28 Aug 2020, 17:30 last edited by
                          #12

                          I got it working. Thank you for all your help.

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 28 Aug 2020, 17:36 last edited by
                            #13

                            Great !

                            What did you do ?

                            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
                            2
                            • S Offline
                              S Offline
                              sozhg
                              wrote on 3 Sept 2020, 03:34 last edited by
                              #14

                              I met this error on Windows, could you please share your experience on how to solve it?

                              1 Reply Last reply
                              0

                              3/14

                              26 Aug 2020, 20:29

                              11 unread
                              • Login

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