在linux下安装QT的方法如下:

tarxfzqt-x11-2.3.2.tar.gz
cdqt-2.3.2
exportQTDIR=$PWD
exportPATH=$QTDIR/bin:$PATH
exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
./configure-no-opengl
结果可能会报错:
Infileincludedfromkernel/qt_x11.h:76,
fromkernel/qpsprinter.cpp:97:
/usr/X11R6/include/X11/Xft/Xft.h:35:31:freetype/freetype.h:没有那个文件或目录
Infileincludedfromkernel/qt_x11.h:76,
fromkernel/qpsprinter.cpp:97:
/usr/X11R6/include/X11/Xft/Xft.h:52:syntaxerrorbefore`;'token
/usr/X11R6/include/X11/Xft/Xft.h:86:'FT_UInt'isusedasatype,butisnot
definedasatype.
/usr/X11R6/include/X11/Xft/Xft.h:93:'FT_UInt'isusedasatype,butisnot
definedasatype.
/usr/X11R6/include/X11/Xft/Xft.h:190:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:295:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:354:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:393:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:399:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:408:typespecifieromittedforparameter`
FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:408:parseerrorbefore`,'token
/usr/X11R6/include/X11/Xft/Xft.h:418:parseerrorbefore`*'token
/usr/X11R6/include/X11/Xft/Xft.h:461:parseerrorbefore`*'token
make[2]:***[kernel/qpsprinter.o]Error1
make[2]:Leavingdirectory`/opt/qt-2.3.2/src'
make[1]:***[sub-src]Error2
make[1]:Leavingdirectory`/opt/qt-2.3.2'
make:***[init]Error2

解决方法:

cd/usr/include
ln-sfreetype2/freetypefreetype

然后再回到qt-2.3.2再make即可