Ubuntu环境QT出现:-1: error: cannot find -lGL(已解决)

Ubuntu17.04安装完qt之后,构建项目就会出现:-1: error: cannot find -lGL

执行 sudo apt-get install libgl1-mesa-dev

安装成功就可以解决了。

注:如果使用 sudo apt-get install libgl1-mesa-dev 一直提示错误,说依赖关系被破坏。则需要进行源的配置与更新

### 修改源命令:

sudo gedit /etc/apt/sources.list

### 把sources.list内容替换成一下内容

##阿里云

deb http://mirrors.aliyun.com/ubuntu/ zesty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ zesty-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ zesty-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ zesty-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ zesty-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ zesty main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ zesty-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ zesty-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ zesty-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ zesty-proposed main restricted universe multiverse

deb http://archive.canonical.com/ubuntu/ zesty partner

deb http://extras.ubuntu.com/ubuntu/ zesty main

你可能感兴趣的:(Ubuntu环境QT出现:-1: error: cannot find -lGL(已解决))