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

<GL/gl.h> not found in Linux

Scheduled Pinned Locked Moved Solved General and Desktop
19 Posts 6 Posters 70.3k Views 2 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.
  • G Offline
    G Offline
    gilgil
    wrote on last edited by
    #5

    Try to install libgl-dev.

    sudo apt-get install libgl-dev

    R 1 Reply Last reply
    5
    • S Offline
      S Offline
      Stephan1001
      wrote on last edited by
      #6

      Hi,
      I am trying to compile some QT examples under linux mint 18 and get the same errors. I am using the nvidia drivers. The QT Creator is from the standard repositories. Since many people seem to suffer from this, there are many solutions on the web. I tried these:

      sudo apt-get install libgl-dev
      sudo apt-get install mesa-common-dev
      sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1-mesa-dev
      sudo apt-get install libxi-dev build-essential libdbus-1-dev libfontconfig1-dev libfreetype6-dev libx11-dev
      apt-get install libqt4-dev zlib1g-dev libqt4-opengl-dev

      and also made symbolic links, all to no avail. When I run: locate libGL I get this output:

      /usr/lib/libGL.so
      /usr/lib/chromium-browser/libGLESv2.so
      /usr/lib/i386-linux-gnu/libGLU.so.1
      /usr/lib/i386-linux-gnu/libGLU.so.1.3.1
      /usr/lib/i386-linux-gnu/mesa/libGL.so.1
      /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
      /usr/lib/nvidia-375/libGL.so
      /usr/lib/nvidia-375/libGL.so.1
      /usr/lib/nvidia-375/libGL.so.1.0.0
      /usr/lib/nvidia-375/libGLESv1_CM.so
      /usr/lib/nvidia-375/libGLESv1_CM.so.1
      /usr/lib/nvidia-375/libGLESv1_CM_nvidia.so.1
      /usr/lib/nvidia-375/libGLESv1_CM_nvidia.so.375.39
      /usr/lib/nvidia-375/libGLESv2.so
      /usr/lib/nvidia-375/libGLESv2.so.2
      /usr/lib/nvidia-375/libGLESv2_nvidia.so.2
      /usr/lib/nvidia-375/libGLESv2_nvidia.so.375.39
      /usr/lib/nvidia-375/libGLX.so
      /usr/lib/nvidia-375/libGLX.so.0
      /usr/lib/nvidia-375/libGLX_indirect.so.0
      /usr/lib/nvidia-375/libGLX_nvidia.so.0
      /usr/lib/nvidia-375/libGLX_nvidia.so.375.39
      /usr/lib/nvidia-375/libGLdispatch.so.0
      /usr/lib/x86_64-linux-gnu/libGL.so
      /usr/lib/x86_64-linux-gnu/libGLESv2.so
      /usr/lib/x86_64-linux-gnu/libGLEW.so
      /usr/lib/x86_64-linux-gnu/libGLEW.so.1.13
      /usr/lib/x86_64-linux-gnu/libGLEW.so.1.13.0
      /usr/lib/x86_64-linux-gnu/libGLU.a
      /usr/lib/x86_64-linux-gnu/libGLU.so
      /usr/lib/x86_64-linux-gnu/libGLU.so.1
      /usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
      /usr/lib/x86_64-linux-gnu/mesa/libGL.so
      /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
      /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
      /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv1_CM.so.1
      /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv1_CM.so.1.1.0
      /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so
      /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
      /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
      /usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so
      /usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1
      /usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1.0
      /usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1.0.0
      /usr/lib/x86_64-linux-gnu/qtcreator/plugins/libGLSLEditor.so
      /usr/lib32/libGL.so
      /usr/lib32/nvidia-375/libGL.la
      /usr/lib32/nvidia-375/libGL.so
      /usr/lib32/nvidia-375/libGL.so.1
      /usr/lib32/nvidia-375/libGL.so.1.0.0
      /usr/lib32/nvidia-375/libGLESv1_CM.so
      /usr/lib32/nvidia-375/libGLESv1_CM.so.1
      /usr/lib32/nvidia-375/libGLESv1_CM_nvidia.so.1
      /usr/lib32/nvidia-375/libGLESv1_CM_nvidia.so.375.39
      /usr/lib32/nvidia-375/libGLESv2.so
      /usr/lib32/nvidia-375/libGLESv2.so.2
      /usr/lib32/nvidia-375/libGLESv2_nvidia.so.2
      /usr/lib32/nvidia-375/libGLESv2_nvidia.so.375.39
      /usr/lib32/nvidia-375/libGLX.so
      /usr/lib32/nvidia-375/libGLX.so.0
      /usr/lib32/nvidia-375/libGLX_indirect.so.0
      /usr/lib32/nvidia-375/libGLX_nvidia.so.0
      /usr/lib32/nvidia-375/libGLX_nvidia.so.375.39
      /usr/lib32/nvidia-375/libGLdispatch.so.0
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGL.rights
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGL.so.1
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGL.so.1.6.0
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGLU.rights
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGLU.so.1
      /usr/local/MATLAB/R2016b/sys/opengl/lib/glnxa64/libGLU.so.1.3.1

      along with some steam and playonlinux stuff. My Matlab installation and steam work fine with OpenGL.
      It there anything I can do to resolve this?

      Regards,
      Stephan

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #7

        Hi and welcome to devnet,

        What version of Qt did you install on your 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
        0
        • S Offline
          S Offline
          Stephan1001
          wrote on last edited by Stephan1001
          #8

          Hi,
          Thanks for the response. From the standard Mint repositories, I installed this version:

          • Qt Creator 3.5.1

          • Based on Qt 5.5.1 (GCC 5.2.1 20151129, 64 bit)

          I notice that the error I get is slightly different from the one at the top of the topic: fatal error: QtOpenGL: No such file or directory but it appears to be related.

          Regards,
          Stephan

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #9

            I meant Qt itself not Qt Creator.

            If you didn't use the Qt installer then you should check the Qt 5 packages that you have installed in Ming. You might be missing some of them.

            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
            0
            • S Offline
              S Offline
              Stephan1001
              wrote on last edited by
              #10

              ah, sorry. I found this in the software manager:
              Qt5-default: 5.5.1+dfsg-16ubuntu7.2
              Libqt5qml5: 5.5.1-2ubuntu6
              Libqt5quick5: 5.5.1-2ubuntu6

              is this what you meant? Or can I run a command that reveals the correct version?

              regards,
              Stephan

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #11

                Then it's Qt 5.5.1.

                I don't know if Mint does any customisation for the packaging however AFAIK, from the ubuntu repo, you should install qt5-default which should install the basics for Qt 5 development.

                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
                • S Offline
                  S Offline
                  Stephan1001
                  wrote on last edited by
                  #12

                  I see that someone else had a similar problem with the mint version: https://forum.qt.io/topic/77370/problems-running-opengl-libraries/5
                  I will try the installer from the website tomorrow.
                  Thanks

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Stephan1001
                    wrote on last edited by
                    #13

                    Hi,
                    I installed QT from the website, now the OpenGL example compiles without problems --> The Mint people seem to have packaged QT incorrectly.
                    I do however get this warning when running the OpenGL example "boxes"

                    This demo can be GPU and CPU intensive and may
                    work poorly or not at all on your system.

                    Is this a general warning? My system is capable enough, core i7 with nvidia gtx770

                    Well, seems my problem is solved,
                    Thanks, regards,
                    Stephan

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      What drivers are you using for your card ? The binary from nVidia ?

                      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
                      0
                      • S Offline
                        S Offline
                        Stephan1001
                        wrote on last edited by
                        #15

                        yes, the binary drivers, version 375.39 from the Mint repository :-)
                        the example runs smooth and the CPU load is below 5%. The compile output suggests that OpenGL is working:
                        22:57:54: Starting: "/usr/bin/make"
                        gcc -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../boxes -I. -I/home/stephan/QT/5.8/gcc_64/include -I/home/stephan/QT/5.8/gcc_64/include/QtOpenGL -I/home/stephan/QT/5.8/gcc_64/include/QtWidgets -I/home/stephan/QT/5.8/gcc_64/include/QtGui -I/home/stephan/QT/5.8/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/stephan/QT/5.8/gcc_64/mkspecs/linux-g++ -o fbm.o ../boxes/3rdparty/fbm.c
                        g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../boxes -I. -I/home/stephan/QT/5.8/gcc_64/include -I/home/stephan/QT/5.8/gcc_64/include/QtOpenGL -I/home/stephan/QT/5.8/gcc_64/include/QtWidgets -I/home/stephan/QT/5.8/gcc_64/include/QtGui -I/home/stephan/QT/5.8/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/stephan/QT/5.8/gcc_64/mkspecs/linux-g++ -o glbuffers.o ../boxes/glbuffers.cpp

                        and so on. Exits without warnings.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #16

                          Don't worry for that warning, it's a message that's currently shown whatever your hardware is. The example itself is pretty old and from a quick look there was a plan to only show it when hardware was underpowered but it seems it didn't happen yet.

                          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
                          0
                          • S Offline
                            S Offline
                            Stephan1001
                            wrote on last edited by
                            #17

                            Good to hear. All works well now, including bluetooth (which would have been my next question with the Mint package...)
                            Thanks!

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #18

                              You're welcome !

                              Happy coding ! :)

                              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
                              0
                              • G gilgil

                                Try to install libgl-dev.

                                sudo apt-get install libgl-dev

                                R Offline
                                R Offline
                                rogerCassares
                                wrote on last edited by
                                #19
                                This post is deleted!
                                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