Install Qt 5.5.1and Qt Creator3.6.0 in Ubuntu 14.04
2016-01-27 18:04
1406 查看
Install Qt 5.5 in Ubuntu 14.04For 32bit
wget http://download.qt-project.org/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x86-5.5.1.run chmod +x qt-opensource-linux-x86-5.5.1.run ./qt-opensource-linux-x86-5.5.1.runFor 64bit
wget http://download.qt-project.org/official_releases/qt/5.5/5.5.0/qt-opensource-linux-x64-5.5.1.run chmod +x qt-opensource-linux-x64-5.5.1.run ./qt-opensource-linux-x64-5.5.1.runInstall g++Open a terminal and execute the following command to install g+:
sudo apt-get install build-essentialConfigure a compilerLaunch Qt Creator. Go to Tools > Options. Click Build & Run and select tab Kit. Configure a compiler if it is not automatically detected.Install OpenGL librariesExecute the following command to install OpenGL libraries:
sudo apt-get install mesa-common-devNote: 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 -yTested with Qt5.3.1 and Ubuntu 14.04 and it solved the problem with missing -lGL.Set file association with pro filesWhen 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=/opt/Qt5.5.1/Tools/QtCreator/bin/qtcreator %f Icon=/opt/Qt5.5.1/Examples/Qt-5.5/location/mapviewer/resources/icon.png Name[en_US]=Qt-CreatorPlace this file in /usr/share/applications .Edit a file named “defaults.list” in the same directory .Add the following line.
text/qtcreator=Qt-Creator.desktop;open file mimeinfo.cache and check if the following line is present.
application/vnd.nokia.qt.qmakeprofile=qtcreator.desktopif not add itRun the following command.
sudo update-mime-database /usr/share/mimenow Qt has been added to the list of file associations.when you open .pro file, if it cannot fine qtcreator to open it, you can open ti with qtcreator manually at first time. then it will be associtated automatically.
Troubleshooting
Qt Creator needs a compiler set up to buildFollow the instruction from the previous section to configure compiler for Qt Creator.error: g++: Command not foundSolution:sudo apt-get install build-essentialerror: GL/gl.h: No such file or directorySolution:
sudo apt-get install mesa-common-dev
install creator3.6.0
go to link https://www.qt.io/download-open-source/#section-6
download: qt-creator-opensource-linux-x86_64-3.6.0.run
chmod +x qt-creator-opensource-linux-x86_64-3.6.0.run
./qt-creator-opensource-linux-x86_64-3.6.0.run
In the end, we change the associated exec to the qtcreator we've just installed.
相关文章推荐
- Qt之进程间通信(共享内存)
- Qt之进程间通信(共享内存)
- windows安装PyQt5
- PyQt学习笔记01-Qt基本概念进阶篇之窗口布局,对话框
- QT发布时经常出现的问题
- QTP检查点使用
- QTP 同步点设置
- qt视频渲染画面闪烁
- C#学习之LinqtoSql类的简单例子
- 在 QT 中使用 libusb 检测 MAC 上的 USB 设备
- Qt之自定义界面(右下角冒泡)
- Qt之自定义界面(右下角冒泡)
- Qt(11):QT的绘制系统
- qt不能调试
- qt的多语言
- Qt之进程间通信(Windows消息)
- Qt之进程间通信(Windows消息)
- Qt之进程间通信(IPC)
- Qt之进程间通信(IPC)
- QTP之excel操作函数整理