Qt在CentOS中沒法編譯的問題(error: cannot find -lGL)

安裝CentOS 7 64位和Qt5.8,建立一個應用程序卻提示沒法編譯,系統提示:code

error: cannot find -lGL
error: collect2: error: ld returned 1 exit status

從上得知應該是缺乏OpenGL庫所致,那麼只要安裝OpenGL庫就行了。it

打開CentOS終端,輸入下面的命令從網上自動下載OpenGL並安裝(需root權限):編譯

su root
yum install mesa-libGL-devel mesa-libGLU-devel
yum install freeglut-devel

如今就能夠正常編譯和運行QtForCentOS程序啦!終端

相關文章
相關標籤/搜索