ubuntu14.04安装QT4.7.4

1 准备源代码:

下载qt-everywhere-opensource-src-4.7.4.zip,下载地址:http://download.qt.io/archive/qt/4.7/

解压到~/qt

2 配置Ubuntu

确保已安装 autoconf、automake 和 libtool。如果没有安装,或者不确定,可输入下列命

令进行安装:

$ sudo apt-get install autoconf

$ sudo apt-get install automake

$ sudo apt-get install libtool

sudo apt-get install libX11-dev libXext-dev libXtst-dev

3 配置QT

@ubuntu:~/qt/qt-everywhere-opensource-src-4.7.4$ ../configure -prefix /usr/local/qt/qt_4.7.4/qt_x86

出现错误:“You don't seem to have 'make' or 'gmake' in your PATH. cannot proceed”
解决:export MAKE=/usr/bin/make

4 编译

make -j8

5 安装

make install

6 添加环境变量

sudo vim /etc/profile

export PATH=/usr/local/qt/qt_4.7.4/qt_x86/bin:$PATH

source /etc/profile

qmake -v

QMake version 2.01a
Using Qt version 4.7.4 in /usr/local/qt/qt_4.7.4/qt_x86/lib

7 qt creator安装

直接在应用商店中安装。

8  配置qt creator

在tools->options->Build&Run->Qt Versions

ubuntu14.04安装QT4.7.4_第1张图片

Remove,添加上面编译的qmake;

ubuntu14.04安装QT4.7.4_第2张图片

Kits,添加如下:

ubuntu14.04安装QT4.7.4_第3张图片

QT4.7.4 X86配置完毕。



你可能感兴趣的:(Ubuntu)