安装CentOS 7 64位和Qt5.8,创建一个应用程序却提示无法编译,系统提示:

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

从上得知应该是缺少OpenGL库所致,那么只要安装OpenGL库就好了。

打开CentOS终端,输入下面的命令从网上自动下载OpenGL并安装(需root权限):

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

现在就可以正常编译和运行QtForCentOS程序啦!

转载于:https://my.oschina.net/u/3489228/blog/1538469

Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐