linux下安装QT的方法
2015-08-31 20:09
453 查看
1、下载qt_sdk安装???
2、命令安装(在线安装)
首先在命令行输入apt-get update
然后输入 apt-cache search qtcreator
然后输入 apt-get install qtcreator
3、下载QT的源码自己编译。
自己下载QT源码,如: qt-soruce-4.7.4.tar
在命令行输入 tar –xzvf qt-soruce-4.7.4.tar解压源码
然后参照http://wiki.qt.io/Building_Qt_5_from_Git这个网址的方法(见下面)
先安装QT的环境然后手动编译QT源码即可。
Started with Qt page.
Qt for X11 has some requirements that are given in more detailin the Qt for X11 Requirementsdocument.
For the opensource version you do not need a license file.
type the following commands at a command line prompt:
This creates the directory
We only support the GNUversion of the tar archiving utility. Note that on some systems it is calledgtar.
By default, Qt is configured for installation in the
by using the
The Configure Options page contains more information aboutthe configure options.
To create thelibrary and compile all the examples, tools, and tutorials, type:
If
the appropriate place. To do this (as root ifnecessary), type:
Note that onsome systems the make utility is named differently, e.g. gmake. The configurescript tells you which make utility to use.
Note: If you laterneed to reconfigure and rebuild Qt from the same location, ensure that alltraces of the previous configuration are removed
by entering the builddirectory and typing
This is donelike this:
In
In
If you use adifferent shell, please modify your environment variables accordingly.
For compilers that do not support rpath you must also extendedthe
On Linuxwith GCC this step is not needed.
qt的环境变量:
1,
export QTDIR=/home/yupont/qt453
export QTLIB=$QTDIR/lib
export QTINC=$QTDIR/include
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
export MANPATH=$QTDIR/man:$MANPATH
export PATH=$QTDIR/bin:$PATH
不知道是不是都要设置
QTLIB和LD_LIBRARY_PATH有啥区别?
2,
export QTDIR=/home/d5000/qt453
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
2、命令安装(在线安装)
首先在命令行输入apt-get update
然后输入 apt-cache search qtcreator
然后输入 apt-get install qtcreator
3、下载QT的源码自己编译。
自己下载QT源码,如: qt-soruce-4.7.4.tar
在命令行输入 tar –xzvf qt-soruce-4.7.4.tar解压源码
然后参照http://wiki.qt.io/Building_Qt_5_from_Git这个网址的方法(见下面)
先安装QT的环境然后手动编译QT源码即可。
Qt for Linux/X11 - Building fromSource
You can download the Qt 5 sources from the Downloads page. For more information, visit the GettingStarted with Qt page.
Qt for X11 has some requirements that are given in more detailin the Qt for X11 Requirementsdocument.
Step 1:Installing the License File (Commercial Editions Only)
If you have the commercial edition of Qt, install your licensefile as$HOME/.qt-license.
For the opensource version you do not need a license file.
Step 2: Unpacking the Archive
Unpack the archive if you have not done so already. For example,if you have theqt-everywhere-opensource-src-%VERSION%.tar.gzpackage,
type the following commands at a command line prompt:
cd /tmp
gunzip qt-everywhere-opensource-src-%VERSION%.tar.gz # uncompress the archive
tar xvf qt-everywhere-opensource-src-%VERSION%.tar # unpack it
This creates the directory
/tmp/qt-everywhere-opensource-src-%VERSION%containing the files from the archive.
We only support the GNUversion of the tar archiving utility. Note that on some systems it is calledgtar.
Step 3: Building the Library
To configure the Qt library for your machine type, run the./configurescript in the package directory.
By default, Qt is configured for installation in the
/usr/local/Qt-%VERSION%directory, but this can be changed
by using the
-prefixoption.
cd /tmp/qt-everywhere-opensource-src-%VERSION%
./configure
The Configure Options page contains more information aboutthe configure options.
To create thelibrary and compile all the examples, tools, and tutorials, type:
make
If
-prefixis outside the build directory, you need to install the library,examples, tools, and tutorials in
the appropriate place. To do this (as root ifnecessary), type:
make install
Note that onsome systems the make utility is named differently, e.g. gmake. The configurescript tells you which make utility to use.
Note: If you laterneed to reconfigure and rebuild Qt from the same location, ensure that alltraces of the previous configuration are removed
by entering the builddirectory and typing
makeconfcleanbeforerunning
configureagain.
Step 4: Set the Environment Variables
In order touse Qt, some environment variables needs to be extended.PATH - to locate qmake, moc and other Qt tools
This is donelike this:
In
.profile(if your shell is bash, ksh, zsh or sh), add the followinglines:
PATH=/usr/local/Qt-%VERSION%/bin:$PATH
export PATH
In
.login(in case your shell is csh or tcsh), add the following line:
setenv PATH /usr/local/Qt-%VERSION%/bin:$PATH
If you use adifferent shell, please modify your environment variables accordingly.
For compilers that do not support rpath you must also extendedthe
LD_LIBRARY_PATHenvironment variable to include
/usr/local/Qt-%VERSION%/lib.
On Linuxwith GCC this step is not needed.
qt的环境变量:
1,
export QTDIR=/home/yupont/qt453
export QTLIB=$QTDIR/lib
export QTINC=$QTDIR/include
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
export MANPATH=$QTDIR/man:$MANPATH
export PATH=$QTDIR/bin:$PATH
不知道是不是都要设置
QTLIB和LD_LIBRARY_PATH有啥区别?
2,
export QTDIR=/home/d5000/qt453
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
相关文章推荐
- 【linux下用C语言编写带图形界面的成绩管理系统附带源代码】
- Linux系统编程笔记
- 在osx下通过vmware无GUI方式运行centos 7
- linux下编译log4cpp的方法
- centos下安装gitlab
- linux C语言实现递归删除文件文件夹功能
- Linux学习笔记--------“./a.out”是什么意思???
- Linux学习笔记------如何执行一个 可执行程序???
- 28个Unix/Linux的命令行神器
- 应该知道的Linux技巧
- Linux安装
- linux下 常用命令
- PHP在linux上执行外部命令
- linux基本命令
- Linux NAT Router 桥作为WAN,桥下接口作为LAN如何使用
- linux运维实战练习-2015年8月27日课程作业
- linux下ppp的移植及ppp0路由设置
- Linux给用户添加sudo权限
- Linux运维工程师入门须掌握的10个技术点
- Linux下使用nexus搭建maven私服