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

摘要:
官网介绍:https://wiki.qt.io/Install_Qt_5_on_UbuntuContents[hide]1InstallQt5onUbuntu1.1Introduction1.2InstallationGuide1.3Troubleshooting1.4ReferencesInstallQt5onUbuntuIntroductionThisisatutorialforinstall

官网介绍: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

强烈建议从http://download.qt.io/official_releases/qt 下载

  • Download

Visit Qt downloads page andownload a 32-bit or 64-bit Linux installationdepending 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

LaunchQt Creator. Go toTools > Options. ClickBuild & Runand select tabKit. 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.Archivedfrom 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.

免责声明:文章转载自《Qt ------ 在 ubuntu 内安装 Qt creator》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Blend基础数据绑定keil软件相关问题汇总下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

索引节点(inode)爆满问题处理

后来,我用df-I检查/data分区的索引节点,发现它已满,这导致系统无法创建新的目录和文件。inode是用于存储这些数据的信息,包括文件大小、所有者、用户组、读写权限等。inode索引每个文件的信息,因此它具有inode的值。根据指令,操作系统可以通过inode值最快找到对应的文件。故障排除的原因是/data/cache目录中有大量小字节缓存文件,这些文件...

Jmeter中获取返回结果中的值

在jmeter的测试中,通常需要在下一个请求中使用上一个请求的返回值。如何获得返回值非常重要。插件下载地址为:http://jmeter-plugins.org/wiki/JSONPathExtractor/下载后,将lib文件夹放在jmeter目录中。...

硬中断与软中断的区别!

在多核系统上,一个中断通常只能中断一个CPU(也有一种特殊情况,即主机上有一个硬件通道。它可以在没有主CPU支持的情况下同时处理多个中断。软中断:1。软中断与硬中断非常相似。生成软中断的进程必须是当前正在运行的进程,因此它们不会中断CPU。...

C# winform开发嵌套Chrome内核浏览器(WebKit.net)开发(一)

//Www.cnblogs.com/Maxq/p/6566558.htmlWebKit.net是WebKit的一个net包。使用它,。net程序可以非常方便地集成和使用webkit作为加载网页的容器。EventArgse){WebKit.WebKitBrowser=newWebKitBrowser();this.Controls.Add(浏览器);...

pycharm最新版本激活码(永久有效) python安装教程

输入python以查看当前版本的python。您可以输入“print'helloworld”并单击下载以启动PyCharm://pan.baidu.com//1eVdm4dUPKn3ZY_Xj kqNXw提取代码:l83f2,下载破解补丁(版本2018.3.5)下载链接至地址:...

js 浏览器窗口 刷新、关闭事件

当前页面不会直接关闭,可以点击确定按钮关闭或刷新,也可以取消关闭或刷新。...