Qt 5.12:无法在“ / usr / include / libdrm”中找到“ GL / gl.h”

时间:2019-11-10 10:20:33

标签: qt opengl cmake nvidia ubuntu-18.04

我有一个全新安装的Ubuntu 18.04.3系统(NVIDIA),仅安装了Qt SDK 5.12.5build-essentialgitCMake。我正在尝试通过在Qt Creator中打开主要的CMakeLists.txt来构建Qt项目:

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)

我还应该安装什么?

注意:我根本没有从存储库安装Qt。仅通过官方的在线安装程序。

2 个答案:

答案 0 :(得分:5)

您需要mesa个软件包。

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

$ apt install mesa-common-dev libglu1-mesa-dev
并尝试。

答案 1 :(得分:1)

如果使用Fedora / RHEL的任何人发现了这个问题,则mesa软件包的名称在此有所不同。

  • mesa-libGL
  • mesa-libGL-devel

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

来源:https://access.redhat.com/solutions/56301