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 ...
随机推荐
- 学习jvm,关于MAT an internal error occurred during:"Parsing heap dump" from问题
写了一个死循环不断的创建对象,模拟内存溢出 package com.zuo.test1; import java.util.ArrayList; import java.util.List; publ ...
- ajax请求携带 cookie
之前都有这样一个理解:ajax请求时是不会自动带上cookie的,要是想让他带上的话,必须哟啊设置withCredential为true.这个说法会让人产生完全扭曲的误解,我就是其中之一.完整的无歧义 ...
- React diff机制(介绍虚拟DOM的机制)
https://segmentfault.com/a/1190000004003055
- sudo不用在输入密码
在任意的路径之下执行:sudo visudo 的命令对文件进行修改: 其中的: sudo ALL=(ALL) %admin ALL=(ALL) 这两个语句为: sudo ALL=(ALL) NOPAS ...
- 什么是面向对象以及其意义,prototpye原型
什么是面向对象: 使用对象时,只关注对象提供的功能,不关注其内部的细节 例如:jquery 什么是对象: 对象是一个整体对外提供一些操作,比如 收音机 面向对象编程OOP的特点: 1.抽象:把主要的特 ...
- SpringBoot项目maven 打包时跳过测试
在打包spring boot项目时,如果测试用例特别多,打包时间会增加: 而且测试用例有时忘记了做相应修改,在打包时则会报错而终止打包,就很烦. 所以这时会想在打包时跳过测试,大致有2种方法: 方法一 ...
- Qt之图形(渐变填充)
简述 QGradient可以和QBrush组合使用,来指定渐变填充. Qt目前支持三种类型的渐变填充: QLinearGradient:显示从起点到终点的渐变. QRadialGradient:以圆心 ...
- [MST] Build Forms with React to Edit mobx-state-tree Models
We will expand our UI, and give the user the possibility to edit his wishlist. We will use the earli ...
- Android 最火的高速开发框架xUtils
Github下载地址:https://github.com/wyouflf/xUtils xUtils简单介绍 xUtils 包括了非常多有用的Android工具. xUtils 最初源于Afinal ...
- poj_3468,线段树成段更新
参考自http://www.notonlysuccess.com/index.php/segment-tree-complete/ #include<iostream> #include& ...