Install Qt 5 on Ubuntu(使用qt-opensource-linux-x64-5.7.0.run进行安装,而且是官方的wiki)
Introduction
This is a tutorial for installation of Qt 5.7.0 to Ubuntu 12.10. It may be used also for newer versions of Qt and Ubuntu. A difference for OpenGL has been found and added as a note below.
Installation Guide
- Download
Visit Qt downloads page an download a 32-bit or 64-bit Linux installation depending your version of Ubuntu. The installation file can be also downloaded through the command line using wget.
Example:
wget http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-linux-x64-5.7.0.run
- Install
Adjust permission, run the installer and follow the instruction to complete the installation.
chmod +x qt-opensource-linux-x64-5.7.0.run
./qt-opensource-linux-x64-5.7.0.run
- Install g++
Open a terminal and execute the following command to install g++:
sudo apt-get install build-essential
- Install generic font configuration library - runtime
Open a terminal and execute the following command to install the full runtime files for the generic font configuration library:
sudo apt-get install libfontconfig1
- Configure a compiler
Launch Qt Creator. Go to Tools > Options. Click Build & Run and select tab Kit. Configure a compiler if it is not automatically detected.
- Install OpenGL libraries
Execute the following command to install OpenGL libraries:
sudo apt-get install mesa-common-dev
Note: Just installing the above-mentioned mesa-common-dev kit is not sufficient for more recent Ubuntu versions. Based on a comment in the Qt forum[1] an additional package needs installation. Execute following command:
sudo apt-get install libglu1-mesa-dev -y
Tested with Qt5.3.1 and Ubuntu 14.04 and it solved the problem with missing -lGL.
- Set file association with pro files
When installing from the on-line source the file association is not done automatically. It also not show up when you try to associate it with file explorer. Create a file named “Qt-Creator.desktop” and fill the file with the following.
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=QtCreator
Comment=QtCreator
NoDsiplay=true
Exec=(Install folder of QT)/Tools/QtCreator/bin/qtcreator %f
Icon=(Install folder of QT)/5.4/Src/qtdoc/doc/images/landing/icon_QtCreator_78x78px.png
Name[en_US]=Qt-Creator
Place this file in home .local/share/applications .
Edit a file named “defaults.list” in the same directory . Add the following line.
text/qtcreator=Qt-Creator.desktop;
open file mimeapps.list and check if the following line is present.
application/vnd.nokia.qt.qmakeprofile=qtcreator.desktop
if not add it under [added Associations].
Run the following command.
sudo update-mime-database /usr/share/mime
now Qt has been added to the list of file associations.
Troubleshooting
- Qt Creator needs a compiler set up to build
Follow the instruction from the previous section to configure compiler for Qt Creator.
- error: g++: Command not found
Solution:
sudo apt-get install build-essential
- error: GL/gl.h: No such file or directory
Solution:
sudo apt-get install mesa-common-dev
References
- Jump up↑ Qt 5.5.0 problem running examples [SOLVED]. 2015-09-22. Archived from the original on 2016-08-01. Retrieved 2016-08-01.
Execute the following command to install OpenGL libraries: sudo apt-get install mesa-common-dev Note: Just installing the above-mentioned mesa-common-dev kit is not sufficient for more recent Ubuntu versions. Based on this comment in the forum an additional package needs installation. Execute following command: sudo apt-get install libglu1-mesa-dev -y Tested with Qt5.3.1 and Ubuntu 14.04 and it solved the problem with missing -lGL.
原文地址: http://wiki.qt.io/Install_Qt_5_on_Ubuntu
https://blog.csdn.net/zbc415766331/article/details/80832943
Install Qt 5 on Ubuntu(使用qt-opensource-linux-x64-5.7.0.run进行安装,而且是官方的wiki)的更多相关文章
- Qt在各平台上的搭建qt-everywhere(Qt for windows7-64bit, Ubuntu 12.04-32bit, 嵌入式x86平台, 嵌入式arm平台)
下载地址:http://download.qt.io/ 当进入解压好的源码包后,使用./configure –help命令,可以获得相应帮助,前面是*号的表示默认参数. +号表示该功能要求被评估,评估 ...
- Ubuntu上qt环境的构建
写在前面.......这个教程好像比较早一点了,现在介绍一个新的思路: 整体参见如下步骤(for zedboard): 1.首先下载qt-opensource-linux.run文件,然后跟在Wind ...
- Ubuntu下Qt(Retex)无法输入中文
这个问题从我第一次在Ubuntu上使用Qt便困扰着我,奈何之前一直没认真去解决掉这个问题.今天作死想想,这个不可能解决不掉的.因为那么多人用Ubuntu,而且又那么多人用Qt的产品,比如Retext. ...
- ubuntu 交叉编译qt 5.7 程序到 arm 开发板
ubuntu 交叉编译qt 5.7 程序到 arm 开发板平台1 ubuntu 12.042 arm-linux-gcc 4.5.13 QT 5.74 开发板210 armcortex-A8 一 概述 ...
- 是什么让 Ubuntu 选用 Qt 而不是 GTK?
是什么让 Ubuntu 选用 Qt 而不是 GTK? 一个正在发生的事实,Ubuntu正在不断Qt化!我曾一直在抱怨的Software Center,今日一看源码,竟然有softwarecenter/ ...
- ubuntu下Qt之android环境配置以及一些常见问题解决
准备材料有: 1. qt for android 5.×版本,下载地址如下,可以选择一个合适自己机器型号的版本进行下载. 地址:http://www.qt.io/download-open-sourc ...
- Ubuntu下QT控制台程序无法运行的解决方案以及XTerm的配置方法
Ubuntu下QT控制台程序无法运行的解决方案以及XTerm的配置方法 最近由于老师要求要在Ubuntu下QT上进程多线程服务器的开发,虽然只是单纯的调用qt的network模块,但是为了避免麻烦,我 ...
- ubuntu下Qt链接MySQL: QMYSQL driver not loaded(不用重新编译源码)
先切换到qt数据库驱动目录即:qt安装目录下的gcc_64/plugins/sqldrivers,然后 ldd libqsqlmysql.so 若libmysqlclient.so.18 not fo ...
- Ubuntu下 QT添加外部链接库(.so文件)示例
参考:https://blog.csdn.net/KKALL1314/article/details/81915354 https://forum.qt.io/topic/80301/file-not ...
随机推荐
- 关于wdsl
WSDL元素 WSDL元素基于XML语法描述了与服务进行交互的基本元素: Type(消息类型):数据类型定义的容器,它使用某种类型系统(如XSD). Message(消息):通信数据的抽象类型化定义, ...
- [agc004c]and grid
别问我为什么咕了两天 题意: 给出一个$H\times W$的网格图A,仅由'.'和'#'构成,边界上没有'#'且至少有一个'#'.构造两个网格图B和C,大小均为$H\times W$,要求A中为'# ...
- mysql 百万级查询优化
关于mysql处理百万级以上的数据时如何提高其查询速度的方法 最近一段时间由于工作需要,开始关注针对Mysql数据库的select查询语句的相关优化方法. 由于在参与的实际项目中发现当mysql表的数 ...
- PostGIS解析Geometry几何对象
一.Geometry转WKT select st_astext(geom) where tableName; 二.PostGIS常用函数 wkt转geometry st_geomfromtext(wk ...
- 阿里云部署java项目
第一步:注册阿里云账号(如果有请看第二步) 1.百度搜索阿里云,点击进入阿里云官网 2.点击右上角免费注册 3.进入注册页面,按照要求填写信息 4.注册完成后登陆 登陆之后首先购买阿里云esc与服务器 ...
- 紫书 例题 11-13 UVa 10735(混合图的欧拉回路)(最大流)
这道题写了两个多小时-- 首先讲一下怎么建模 我们的目的是让所有点的出度等于入度 那么我们可以把点分为两部分, 一部分出度大于入度, 一部分入度大于出度 那么显然, 按照书里的思路,将边方向后,就相当 ...
- C#调用带结构体指针的C Dll的方法
在C#中调用C(C++)类的DLL的时候,有时候C的接口函数包含很多参数,而且有的时候这些参数有可能是个结构体,而且有可能是结构体指针,那么在C#到底该如何安全的调用这样的DLL接口函数呢?本文将详细 ...
- 部署OGG时字符集转换问题--oracle to oracle已验证,其他异构环境应当也适用
之前在安装OGG总是遇到字符集问题,尤其是多源端对一个目标端时,源端字符集不同,导致出现字符集问题 无法同步数据,查阅了大量的园子资料,都说要设置复制或抽取进程中SETENV (NLS_LANG=AM ...
- Java8 Lamdba表达式 002
本篇将讲述lamdba表达式的排序,本例包括一个Player对象的集合[稍后定义],通过每一个player的分数高低对列表的player进行排序.类定义001例如以下 public class Sor ...
- C++ double转string类型以及MFC控件简单使用方法
这两天项目须要,測试c++库里面内容.生成jar再给Android调用.我没有学过C++,如今開始记录C++简单使用方法.測试时候一般都是使用mfc程序来測试.要输入值.显示结果吗.我用的编译环境vs ...