step 1 安装依赖库,在安装说明的最下面
- sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
step 2 下载安装包:
http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
step 3 解压 解包
[cpp] view plaincopy
gunzip qt-everywhere-opensource-src-4.8.6.tar.gz # uncompress the archive
tar xvf qt-everywhere-opensource-src-4.8.6.tar # unpack it
step 4 配置生成MakeFile
[cpp] view plaincopy./configure
./configure
//配置的时候可能出现make: g++: Command not found,这时候就可以安装sudo apt-get install build-essential 装好GCC开发环境就好了
step 5 构建
[cpp] view plaincopyprint?make
step 6 安装
[cpp] view plaincopymake install
step 7 配置环境变量
[cpp] view plaincopyPATH=/usr/local/Trolltech/Qt-4.8.6/bin:$PATH
export PATH
step 8 创建连接
sudo ln -s /usr/local/Trolltech/Qt-4.8.6/bin/qmake /usr/lib/i386-linux-gnu/qt4/bin/qmake