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程序啦!终端

相关文章
相关标签/搜索