首页 > 解决方案 > Qt 5.12:在“/usr/include/libdrm”中找不到“GL/gl.h”

问题描述

我有一个新安装的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。只能通过官方在线安装程序。

标签: qtopenglcmakenvidiaubuntu-18.04

解决方案


你需要mesa包裹。

  • 台面通用开发
  • libglu1-台面开发

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


推荐阅读