1、下载qt-embedded-free-3.3.8,下载地址可以参考:
http://www.qtopia.org.cn/ftp/mirror/ftp.trolltech.com/qt/source/
2、解压缩qt-embedded-free-3.3.8到/usr/local/qte-3.3.8
3、进入/usr/local/qte-3.3.8,执行下列命令(可以写入到一个脚本文件一次执行):
cd /usr/local/qte-3.3.8
qmake_file=mkspecs/qws/linux-x86-g++/qmake.conf
sed "/-fno-rtti/d" < $qmake_file > $qmake_file.$
mv $qmake_file.$ $qmake_file
unset QTEDIR
unset QTEINC
unset QTELIB
export QTEDIR=$PWD
export LD_LIBRARY_PATH=$QTEDIR/lib:LD_LIBRARY_PATH
echo yes|./configure -prefix /opt/qte-3.3.8 -qt-gfx-qvfb -depths 4,8,16,24,32 -thread -qt-gift
4、cd /usr/local/qte-3.3.8/include,修改./qglobal.h文件如下:
...
/* The window system, must be one of:(Q_WS_X)
...
*/
#define QWS # 添加本语句
...
5、make,之后会报错说uic找不到libqte-mt.so.3。把/usr/local/qte-3.3.8/lib/libqte-mt.so.3.3.8在/usr/lib里面建立链接文件即可:
ln -s /usr/local/qte-3.3.8/lib/libqte-mt.so.3.3.8 /usr/lib/libqte-mt.so.3
6、make & make install,完成编译和安装