Qt 5.12: Failed to find "GL/gl.h" in "/usr/include/libdrm"
Asked Answered
A

4

27

I have a freshly installed Ubuntu 18.04.3 system (NVIDIA) with only Qt SDK 5.12.5, build-essential, git, and CMake installed. I'm trying to build a Qt project by opening the main CMakeLists.txt in Qt Creator:

Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
  Failed to find "GL/gl.h" in "/usr/include/libdrm".
Call Stack (most recent call first):
  /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:174 (include)
  /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:89 (find_package)
  CMakeLists.txt:89 (find_package)

What should I still install?

Note: I haven't installed Qt from repositories at all. Only via the official online installer.

Adrenal answered 10/11, 2019 at 10:20 Comment(0)
I
43

You need mesa packages.

  • mesa-common-dev
  • libglu1-mesa-dev

$ sudo apt install mesa-common-dev libglu1-mesa-dev
And Try.

Ideation answered 10/11, 2019 at 10:32 Comment(2)
Worked for me. Is this documented anywhere?... The Qt documentation/support should mention it...Bibcock
@Wouzz, mesa packages is a open-source implementation of the OpenGL specification and needed for OpenGL applications.Ideation
O
16

If anybody using Fedora/RHEL finds this question, mesa packages are named differently here.

  • mesa-libGL
  • mesa-libGL-devel

$ sudo dnf install mesa-libGL mesa-libGL-devel

Source: https://access.redhat.com/solutions/56301

Ordure answered 3/11, 2020 at 12:29 Comment(0)
P
6

In OpenSuse Leap mesa packages are named differently too.

Use:

sudo zypper install Mesa-libGL-devel

to solve it.
I tried it with OpenSuse Leap 15.2 and 15.3.

Patagium answered 5/4, 2022 at 3:42 Comment(0)
E
0

For centos 7

sudo yum install libGL-devel
Eipper answered 17/2, 2023 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.