Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 804
juzzlin Avatar asked Nov 10 '19 10:11

juzzlin


3 Answers

You need mesa packages.

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

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

like image 181
Ghasem Ramezani Avatar answered Oct 22 '22 17:10

Ghasem Ramezani


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

like image 28
vadkou Avatar answered Oct 22 '22 15:10

vadkou


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.

like image 4
Sven Wickenhagen Avatar answered Oct 22 '22 16:10

Sven Wickenhagen