Qt ------ 在 ubuntu 内安装 Qt creator

官网介绍:https://wiki.qt.io/Install_Qt_5_on_Ubuntu

Contents

[hide]

Install Qt 5 on Ubuntu

Introduction

This is a tutorial for installation of Qt 5.7.0 to Ubuntu 12.10. It may be used for some newer versions of Qt and Ubuntu. As a counterexample, Ubuntu 16.04 LTS uses an independent system for controlling the Qt version. Following these directions for Ubuntu 16.04 results in an error where a file can‘t be found in a qt4 directory, even though you‘re installing qt5 not 4. Another 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

  1. 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.

原文地址:https://www.cnblogs.com/god-of-death/p/9876625.html

时间: 2024-09-29 23:55:29

Qt ------ 在 ubuntu 内安装 Qt creator的相关文章

ubuntu 15 安装Qt

Linux 下安装 QT5.4.0      http://blog.163.com/[email protected]/blog/static/620810432015027111314471/ Linux qt环境变量设置       http://blog.sina.com.cn/s/blog_5f0d72800100iiw8.html Ubuntu 安装OpenGL         http://blog.csdn.net/zhangliang_571/article/details/2

QT Linux/Ubuntu 平台安装qt5.7.1 2016.12.25

QT 下载: https://www.qt.io/download-open-source/ 查看所有下载项: 下载Linux平台的QT 添加运行权限,并安装 启动QT后,将其锁定到边框 qt ide的命令行模式版 Hello world ! 当然,从命令行也可以直接启动QT createtor qt的pro文件编辑技巧 1.添加库文件静态库 linux:LIBS += your_lib_path/your_lib  linux:LIBS += -L your_lib_path -lyour_l

ubuntu下安装QT

https://www.linuxidc.com/Linux/2017-12/149296.htm https://qtguide.ustclug.org/ch01-04.htm 原文地址:https://www.cnblogs.com/ccpang/p/11520121.html

在Ubuntu下安装imx6linux系统的交叉编译环境遇到的问题总结

这段时间一直忙于手上的嵌入式项目,可以说自己从嵌入式的菜鸟一点点的入门了,关于嵌入式和imx6核心板的开发有了一点的了解,尤其是对于板子环境的搭建.硬件的开发,搭建环境,是一个很大的工程量,也是很重要的一步,环境没有搭好就无法进行下一步.当然这个前提是对项目所使用的硬件有一定的了解.对于嵌入式开发,项目进行到现在,从一个什么都不懂的到现在可以和大家讨论v4l2,framebuffer,讨论linux的视频开发,虽然还是菜鸟级别的,但这个月确实让自己掌握了一们知识. 关于嵌入式的开发,网上有很多的

ubuntu12.04LTS安装QT和QT creator

在qt官网http://download.qt.io/archive/ 下的qt4.8.6 :  http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz 和 qt creator 2.5.2 : http://download.qt.io/archive/qtcreator/2.5/qt-creator-linux-x86-opensource-2.5.2.bin 在终端依次输入以下

ubuntu安装QT4.8.0 和安装QT库

一 .源代码的获取. 官网http://qt.nokia.com/downloads (自己安装的4.8.0) 二.解压代码 tar zxvf qt-everywhere-opensource-src-4.8.0.tar.gz 解压完进入解压后的源代码文件夹 三.执行./configure生成makefile ./configure -prefix /usr/local/Qt-4.8.0 (上面指定的这个目录/usr/local/Qt-4.8.0 ,就是make install 后的安装目录)

Ubuntu 16.04 安装 QT Create 5.3.1

Ubuntu 16.04 安装 QT Create 5.3.1 (qt-opensource-linux-x86-5.3.1.run)后新建一个 QT Quick 的工程.直接编译,出现如下错误的提示: qt cannot find lgl 刚开始按网上的方法,需要修改依赖库的版本,但依赖是一层接着一层,唉...... 最后找到如下的解决方法(参考如下链接: http://blog.csdn.net/u012175418/article/details/52078291): [email pro

ubuntu下安装与卸载qt的方法

http://blog.csdn.net/huyisu/article/details/24014407 ubuntu下安装与卸载qt的方法 分类: linux 2014-04-18 14:20 1843人阅读 评论(0) 收藏 举报 1.在官网下载地址下载: http://qt-project.org/downloads 根据自己需要下载. 我下载的是: qt-opensource-linux-x64-5.2.1.run 2.ct+alt+t,快捷键打开终端,进入下载目录下,执行: ./qt-

ubuntu 12.04下安装Qt出现cannot execute binary file的解决方案

最近在ubuntu 12.04下安装QT的过程中,遇到一个问题. ./qt-opensource-linux-x64-5.7.0.run出现了bash: ./qt-opensource-linux-x64-5.7.0.run: cannot execute binary file. 我用我自己的解决方案分享给大家,同时也为自己以后做个笔记. 第一:查看Linux当前操作系统名称(信息).命令:uname -a出现下面这个:Linux ubuntu 3.5.0-23-generic #35~pre