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. Qt Creator on Linux Mint MATE can't find GL/gl.h
Forum Updated to NodeBB v4.3 + New Features

Qt Creator on Linux Mint MATE can't find GL/gl.h

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 2.4k 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.
  • OscarTheGrouchO Offline
    OscarTheGrouchO Offline
    OscarTheGrouch
    wrote on last edited by
    #1

    Kinda new to Qt Creator, was trying to Build the Qt Widgets Application Example. It has errors.
    First had to copy to user folder, OK no problem.
    Errors with QMessageBox::warning not enough parameters, fix all but the loadFile MessageBox.
    Added some Buttons, may not be correct but no error.
    Tried to Build but fatal error can't find GL/gl.h file ..
    /opt/Qt/6.0.0/gcc_64/include/QtGui/qopengl.h:141: error: GL/gl.h: No such file or directory
    In file included from /opt/Qt/6.0.0/gcc_64/include/QtGui/QtGui:60,
    from /opt/Qt/6.0.0/gcc_64/include/QtWidgets/QtWidgetsDepends:4,
    from /opt/Qt/6.0.0/gcc_64/include/QtWidgets/QtWidgets:3,
    from ../application/mainwindow.cpp:52:
    /opt/Qt/6.0.0/gcc_64/include/QtGui/qopengl.h:141:13: fatal error: GL/gl.h: No such file or directory
    141 | # include <GL/gl.h>
    | ^~~~~~~~~

    Anyone have any ideas?
    Thanks in advance.
    OtG

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

      Hi and welcome to devnet,

      You are missing the OpenGL development package for your distribution. You can use apt-get to install it through the command line.

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

      OscarTheGrouchO 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi and welcome to devnet,

        You are missing the OpenGL development package for your distribution. You can use apt-get to install it through the command line.

        OscarTheGrouchO Offline
        OscarTheGrouchO Offline
        OscarTheGrouch
        wrote on last edited by OscarTheGrouch
        #3

        @SGaist Thanks for the reply.
        I think I do ..
        donald@GW-SX2110G:~$ inxi -Fxzd
        System: Kernel: 5.4.0-58-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: MATE 1.24.0 Distro: Linux Mint 20 Ulyana
        base: Ubuntu 20.04 focal
        Machine: Type: Desktop Mobo: Gateway model: SX2110G v: 1.0A serial: <filter> UEFI: American Megatrends v: P11-A2
        date: 09/07/2012
        CPU: Topology: Dual Core model: AMD E1-1200 APU with Radeon HD Graphics bits: 64 type: MCP arch: Bobcat
        L2 cache: 512 KiB
        flags: lm nx pae sse sse2 sse3 sse4a ssse3 svm bogomips: 5588
        Speed: 777 MHz min/max: 777/1400 MHz Core speeds (MHz): 1: 780 2: 1178
        Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Wrestler [Radeon HD 7310] vendor: Acer Incorporated ALI driver: radeon
        v: kernel bus ID: 00:01.0
        Display: x11 server: X.Org 1.20.8 driver: ati,radeon unloaded: fbdev,modesetting,vesa resolution: 1920x1080~60Hz
        OpenGL: renderer: AMD PALM (DRM 2.50.0 / 5.4.0-58-generic LLVM 10.0.0) v: 3.3 Mesa 20.0.8 direct render: Yes
        Audio: Device-1: Advanced Micro Devices [AMD/ATI] Wrestler HDMI Audio vendor: Acer Incorporated ALI driver: snd_hda_intel
        v: kernel bus ID: 00:01.1
        Device-2: Advanced Micro Devices [AMD/ATI] SBx00 Azalia vendor: Acer Incorporated ALI driver: snd_hda_intel
        v: kernel bus ID: 00:14.2
        Sound Server: ALSA v: k5.4.0-58-generic
        Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Acer Incorporated ALI driver: r8169
        v: kernel port: d000 bus ID: 06:00.0
        IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
        Drives: Local Storage: total: 465.76 GiB used: 106.34 GiB (22.8%)
        ID-1: /dev/sda vendor: Seagate model: ST500DM002-1BD142 size: 465.76 GiB
        Optical-1: /dev/sr0 vendor: ATAPI model: DVD A DH16ACSH rev: JA11 dev-links: cdrom,cdrw,dvd,dvdrw
        Features: speed: 48 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
        Partition: ID-1: / size: 411.16 GiB used: 106.34 GiB (25.9%) fs: ext4 dev: /dev/sda2
        Sensors: System Temperatures: cpu: 56.4 C mobo: N/A gpu: radeon temp: 56 C
        Fan Speeds (RPM): N/A
        Info: Processes: 181 Uptime: 22m Memory: 7.49 GiB used: 3.06 GiB (40.8%) Init: systemd runlevel: 5 Compilers: gcc: 9.3.0
        clang: 10.0.0-4ubuntu1 Shell: bash v: 5.0.17 inxi: 3.0.38

        OtG

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

          These are your machine specs. What you are missing is the package that provides the headers and library for development. What you already have is the stuff to use OpenGL.

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

          OscarTheGrouchO 1 Reply Last reply
          2
          • SGaistS SGaist

            These are your machine specs. What you are missing is the package that provides the headers and library for development. What you already have is the stuff to use OpenGL.

            OscarTheGrouchO Offline
            OscarTheGrouchO Offline
            OscarTheGrouch
            wrote on last edited by
            #5

            @SGaist Oh ok. Can you point me to where I can get them?
            FYI, I tried a NEW project when I try to Build ..
            Cannot find -lGLX
            Cannot find -lOpenGL

            Not sure what the char after the '-' is, looks like a lower case 'L'.
            Thanks for the help, really appreciate it.
            OtG

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              Normally its something like
              sudo apt install mesa-common-dev libglu1-mesa-dev

              OscarTheGrouchO 1 Reply Last reply
              2
              • mrjjM mrjj

                Hi
                Normally its something like
                sudo apt install mesa-common-dev libglu1-mesa-dev

                OscarTheGrouchO Offline
                OscarTheGrouchO Offline
                OscarTheGrouch
                wrote on last edited by
                #7

                @mrjj said in Qt Creator on Linux Mint MATE can't find GL/gl.h:

                Hi
                Normally its something like
                sudo apt install mesa-common-dev libglu1-mesa-dev

                Thanks to the Qt Wiki I was able to get rid of the GLX error with those installs.
                Still get cannot find OpenGL and both Example Project and New Project fail to Build.
                Appreciate any ideas and will look over Wiki some more.
                Thanks
                OtG

                1 Reply Last reply
                1
                • OscarTheGrouchO Offline
                  OscarTheGrouchO Offline
                  OscarTheGrouch
                  wrote on last edited by
                  #8

                  Found this on Qt Wiki about OpenGL ..

                  What should I do when Qt Creator complains about missing OpenGL support?

                  Some parts of Qt Creator, such as the Design mode and QML Profiler, use Qt Quick 2, which relies on OpenGL API for drawing. Unfortunately, the use of OpenGL can cause problems, especially in remote setups and with outdated drivers. In these cases, Qt Creator displays OpenGL-related error messages on the console or records them in the Windows debugger log.

                  Unix

                  Run glxgears for a quick check whether OpenGL works in general. Check the output of glxinfo to get more details like the OpenGL driver and renderer (search for OpenGL in the application's output).

                  If you are using the Mesa driver, you can force OpenGL to be rendered in software by setting the LIBGL_ALWAYS_SOFTWARE environment variable.

                  Disabling plugins

                  You can disable the Qt Creator plugins, at the expense of losing functionality:

                  Launch Qt Creator from command line, with the -noload QmlProfiler -noload QuickDesigner arguments.
                  Disable the plugins permanently by selecting Help > About Plugins.

                  Did export LIBGL_ALWAYS_SOFTWARE=1, still error.
                  Disabled Plugin QmlProfiler Could not find a QuickDesigner, still error

                  env variable LIBGL_ALWAYS_SOFTWARE did not stay after reboot, not sure how to make stay.

                  Any ideas guys?
                  Thanks
                  OtG

                  jsulmJ 1 Reply Last reply
                  0
                  • OscarTheGrouchO OscarTheGrouch

                    Found this on Qt Wiki about OpenGL ..

                    What should I do when Qt Creator complains about missing OpenGL support?

                    Some parts of Qt Creator, such as the Design mode and QML Profiler, use Qt Quick 2, which relies on OpenGL API for drawing. Unfortunately, the use of OpenGL can cause problems, especially in remote setups and with outdated drivers. In these cases, Qt Creator displays OpenGL-related error messages on the console or records them in the Windows debugger log.

                    Unix

                    Run glxgears for a quick check whether OpenGL works in general. Check the output of glxinfo to get more details like the OpenGL driver and renderer (search for OpenGL in the application's output).

                    If you are using the Mesa driver, you can force OpenGL to be rendered in software by setting the LIBGL_ALWAYS_SOFTWARE environment variable.

                    Disabling plugins

                    You can disable the Qt Creator plugins, at the expense of losing functionality:

                    Launch Qt Creator from command line, with the -noload QmlProfiler -noload QuickDesigner arguments.
                    Disable the plugins permanently by selecting Help > About Plugins.

                    Did export LIBGL_ALWAYS_SOFTWARE=1, still error.
                    Disabled Plugin QmlProfiler Could not find a QuickDesigner, still error

                    env variable LIBGL_ALWAYS_SOFTWARE did not stay after reboot, not sure how to make stay.

                    Any ideas guys?
                    Thanks
                    OtG

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @OscarTheGrouch See here: https://doc.qt.io/qt-5/linux.html
                    And do

                    sudo apt-get install build-essential libgl1-mesa-dev
                    

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

                    OscarTheGrouchO 1 Reply Last reply
                    3
                    • jsulmJ jsulm

                      @OscarTheGrouch See here: https://doc.qt.io/qt-5/linux.html
                      And do

                      sudo apt-get install build-essential libgl1-mesa-dev
                      
                      OscarTheGrouchO Offline
                      OscarTheGrouchO Offline
                      OscarTheGrouch
                      wrote on last edited by
                      #10

                      @jsulm Thanks!
                      That did the trick.
                      OtG

                      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