1.安装包
http://download.qt.io/official_releases/qt/4.8/4.8.6/
http://download.qt.io/official_releases/qtcreator/2.6/2.6.1/
因为我的操作系统是64位的,所以安装的64位版本。
2.安装 QtCreator2.6.1
3.安装Qt4.8.6
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/zhu/Qt/qt-x11 opensource-src-4.8.6/mkspecs/linux-g++
再执行./configure即可;
(3)最后,以管理员权限,执行 make && make install 对源文件进行编译,大概时间为两个半小时,看具体电脑性能决定。
4.添加环境变量
在终端输入 vi ~/.bash_profile ,进入文件,在.bash_profile文件末尾添加下面几行
export QTDIR=/usr/local/Trolltech/Qt-4.8.6
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/man:$MANPAT
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
如果要让该配置立刻生效,需要注销当前用户,重新登录或者在终端敲击命令 source ~/.bash_profile 即可。