2017-09-16 68 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