ubuntu16.04 64位系统上安装QT5.6

  • Post author:
  • Post category:其他

一下载安装包,下载地址:https://download.qt.io/official_releases/qt/5.6/5.6.1/

这里只有一个64位的 那么你需要看一看你的ubuntu系统是不是64位的执行:sudo uname –m

如果显示x86_64则是64位的系统

如果显示的是i686则是32位的系统。32位的系统是安装不上去的。

二.安装

1.添加可执行权限

sudo chmod +x  qt-opensource-linux-x64-5.6.1.run 

2.执行文件

sudo ./qt-opensource-linux-x64-5.6.1.run 

这是一个图形安装界面 你只需要一路next就行

三。安装之后建立工程出现了问题


 安装完成后编译出现错误:

/usr/bin/ld: cannot find -lGL
Makefile:202: recipe for target ‘untitled’ failed
collect2: error: ld returned 1 exit status
make: *** [untitled] Error 1
01:24:35: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project untitled (kit: Desktop Qt 5.6.1 GCC 64bit)
When executing step “Make”


原因是5.6.0 的qt默认集成了opengl,但是当前系统没有安装opengl。

执行命令 

sudo apt-get install libgl1-mesa-dev 

之后你就可以使用QT进行编程试验了。


版权声明:本文为hanshengfei原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。