2017-09-16 69 views
-1

在Ubuntu Linux上安装QT 5.9 Creator后,我无法编译和运行使用QT Widgets的示例。这里是G ++调用由QT创建者执行:错误编译qt创建者/ qt小部件示例

g++ -Wl,-rpath,/home/matthias/Qt/5.9.1/gcc_64/lib -o gallery main.o qrc_gallery.o -L/home/matthias/Qt/5.9.1/gcc_64/lib -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 

错误是:

/usr/bin/ld: cannot find -lGL Makefile:245: recipe for target 'gallery' failed collect2: error: ld returned 1 exit status make: *** [gallery] Error 1 20:16:53: The process "/usr/bin/make" exited with code 2. Error while building/deploying project gallery (kit: Desktop Qt 5.9.1 GCC 64bit) When executing step "Make"

显然参数-lGL导致错误。我如何解决这个问题?

+0

尝试安装的libgl1' - 台面 - dev'包 – Dmitry

+0

尝试在这里或谷歌搜索,已经回答了,并在搜索结果先打... – dtech

回答

0

安装libgl1软件包台面-dev的:

sudo apt-get install libgl1-mesa-dev