Qt-4.7.2移植过程

来源:互联网 发布:hdmi传输数据 编辑:程序博客网 时间:2024/05/18 13:42

主机:红帽5.0

arm-linux-gcc:4.5.1

1.下载Qt源码并解压

我下载的为:qt-everywhere-opensource-src-4.7.2.tar.gz

mkdir /root/build_qt
cd /root/build_qt
tar zxvf qt-everywhere-opensource-src-4.7.2.tar.gz
mv  qt-everywhere-opensource-src-4.7.2  qte

cd qte

2.设置安装环境变量,编写install.sh

vim install.sh

export PATH=/usr/local/arm/4.5.1/bin:$PATH
export CPLUS_INCLUDE_PATH=/usr/local/arm/4.5.1/arm-none-linux-gnueabi/include/c++/4.5.1:/usr/local/arm/4.5.1/arm-none-linux-gnueabi/include/c++/4.5.1/arm-none-linux-gnueabi/:/usr/local/arm/4.5.1/arm-none-eabi/include/c++/4.5.1:/usr/local/arm/4.5.1/arm-none-eabi/include/c++/4.5.1/arm-none-eabi:$CPLUS_INCLUDE_PATH

source install.sh

3.修改QTE源码目录中的src/gui/embedded/qmouselinuxtp_qws.cpp文件,添加触摸屏支持

vim src/gui/embedded/qmouselinuxtp_qws.cpp

    QString mousedev;

   if (device.isEmpty()) {

mousedev =QLatin1String("/dev/event0");

/*

#ifdefined(QT_QWS_IPAQ)

# ifdefQT_QWS_IPAQ_RAW

        mousedev =QLatin1String("/dev/h3600_tsraw");

# else

        mousedev =QLatin1String("/dev/h3600_ts");

# endif

#else

        mousedev =QLatin1String("/dev/ts");

#endif

*/

4.需要安装tslib的需要先将tslib库解压好,我的不需要,故不要了,跳过

5.配置编译QTE

vim arm_build.sh

echo yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++  -webkit -qt-libtiff -qt-libmng -qt-mouse-pc -no-mouse-linuxtp -no-neon  -depths 4,8,16,32 -qvfb 2>&1 | tee ./qteconfig.log

source arm_build.sh

便开始进行配置了,其中我删除了有关tslib选项,有需要的要加上

接着会出错:

/root/built_qt/qte/src/corelib/tools/qlocale.cpp: In function ‘char* qdtoa(double, int, int, int*, int*, char**, char**)’:
/root/built_qt/qte/src/corelib/tools/qlocale.cpp:6639: 错误:‘fenv_t’ 在此作用域中尚未声明
/root/built_qt/qte/src/corelib/tools/qlocale.cpp:6639: 错误:expected `;' before ‘envp’
/root/built_qt/qte/src/corelib/tools/qlocale.cpp:6640: 错误:‘envp’ 在此作用域中尚未声明
/root/built_qt/qte/src/corelib/tools/qlocale.cpp:6640: 错误:‘feholdexcept’ 在此作用域中尚未声明
/root/built_qt/qte/src/corelib/tools/qlocale.cpp:6655: 错误:‘fesetenv’ 在此作用域中尚未声明

目前解决方法:把/usr/include中的fenv.h 复制到qlocale.cpp所在目录
并修改#include <fenv.h>为#include "fenv.h"
cp /usr/include/fenv.h /root/build_qt/qte/src/corelib/tools/
#vim /root/build_qt/qte/src/corelib/tools/qlocale.cpp +81
将#include <fenv.h>改成#include "fenv.h"
再source arm_build.sh

没有出错,继续下一步


6.make&& make install 2>&1 | tee ./qtemake.log

便是长时间的编译了......等待

还以为中间会有出错的,但是很给力,一直到结束都没错。好了,一切就绪,接下来就开始做界面了!


原创粉丝点击