Qtopia2.2.0移植

Qtopia2.2.0 移植

第一步:编译 jpeg-6b 得到 jpeg

先使用命令进行配置: ./configure –enable-shared –enable-static –prefix=/install_software –build=i386 –host=arm

然后修改生成的 Makefile , 如下:

CC=  gcc 修改为: CC= arm-linux-gcc

AR= ar rc 修改为: AR= arm-linux-ar rc

AR2= ranlib 修改为: AR2=arm-linux-ranlib

最后是编译和安装

make

安装之前要在安装的路径下面建几个目录: /man/man1 , /lib , /include , /bin, 否则提示:

No such file or directory

make  install-lib

第二步:编译 e2fsprogs-1.41.4 得到 uuid

在源文件目录下建立一个目录放 mke2fs 工具: mkdir build

# cd build

#../configure –with-cc=arm-linux-gcc  –with-linker=arm-linux-ld  --enable-elf-shlibs  --host=arm  -prefix=/install_software/e2fsprogs

编译

#make

错误: In file included from ../../../lib/ext2fs/getsize.c:30:

/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/linux/fd.h:342: error: variable or field `__user'' declared void

/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/linux/fd.h:342: error: parse error before ''*'' token

/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/linux/fd.h:360: error: parse error before ''}'' token

make[2]: *** [getsize.o] Error 1

解决: 在引用 #include 的文档前面加上     #include

(原文没有写清具体是加什么东西,后来参考了一篇blog,解决了。特此感谢!)


在这个过程中关于e2fsprogs-1.39.tar.gz的交叉编译还会出现错误,这个问题挺难解觉,后来搜到一篇文章,我终于解觉了,方法是
修改/usr/local/arm/3.4.1/arm-linux/sys-include/linux
中fd.h
添加#include <linux/compiler.h>


安装

make install-libs

第三步: 编译触摸屏共享库 tslib-1.0(tslib-1.4 版本 )

1 # cd tslib-1.0/   进入 tslib 的目录

2 # ./autogen.sh   生成 config 文件

3 # echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache  // 为了防止出现 undefined reference to `rpl_malloc'' 错误

4 # ./configure –host=arm-linux –cache-file=arm-linux.cache  -enable-inputapi=no   --prefix=/opt/tslib1.4       //--prefix 增加安装路径

5 make

6 make install

7 )库文件在 /tslib-1.0/src/.lib

8 )拷贝各种文件

  # cp ts_calibrate ts_harvest ts_print ts_print_raw ts_test    /long_nfs/myfs-1/qtopia/bin/tests/   // 为根文件系统

# cp libts-0.0.so.0*  /long_nfs/myfs-1/qtopia/lib

# cp libts.so   /long_nfs/myfs-1/qtopia/lib

# cp tslib-1.0/plugins/.libs/*.so   /long_nfs/myfs-1/qtopia/lib/ts

第四步:实现 qtopia-free-2.2.0 的移植

(1)       拷贝库文件

拷贝 uuid

       cp –rfv   build/lib/uuid    qtopia/include

       cp –fvr   build/lib/libuuid.so*  /usr/local/arm/3.4.1/arm-linux/lib

       拷贝 jpeg

       cp -rfv libjpeg.so*  /Qtopia-repot/qtopia-free-2.2.0/qt2/lib

       cp -fvr jpeglib.h  /Qtopia-repot/qtopia-free-2.2.0/qt2/include  // 解压出来没有 include 这个文件

       cp -rfv libjpeg.so*  /Qtopia-repot/qtopia-free-2.2.0/qtopia/lib

       cp -fvr jpeglib.h  /Qtopia-repot/qtopia-free-2.2.0/qtopia/include //include 是自己建立的,以后连接的时候注意一下路径

(2) 配置命令如下:

        ./configure -qte ''embedded -no-xft -xplatform linux-arm-g++ -qc

onfig qpe -depths 16,32 -no-qvfb -system-jpeg -gif -tslib'' -qpe ''-xplatform linux-arm-g++ -edition

pda -displaysize 240x320'' -qt2 ''-no-xft'' -dqt ''-no-xft''

(3) 修改文件

  vi/home/arm/qtopia-free-2.2.0/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf

将此行 QMAKE_LIBS_QT = -lqte
   
修改为
    QMAKE_LIBS_QT = -lqte -lpng -lts -lz -luuid –ljpeg  //(-lpng
需要 png 库, -lts                 是连接 ts 库的 )  

(4)       export QTDIR=/home/arm/qtopia-free-2.2.0/qt2

       export QPEDIR=/home/arm/qtopia-free-2.2.0/qtopia

       export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBRARY_PATH

       export TMAKEDIR=/home/arm/qtopia-free-2.2.0/tmake

export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++

cd $QPEDIR/src/libraries/qtopia
         cp custom-linux-ipaq-g++.cpp custom-linux-arm-g++.cpp
         cp custom-linux-ipaq-g++.h custom-linux-arm-g++.h
 

(5)       另外一种 configure 方式,建议使用这种

#./configure -qte "-embedded -xplatform linux-arm-g++ -qconfig qpe-no-qvfb -depths 16,24 -system-jpeg -system-libpng -system-zlib -tslib -gif -thread -no-xft -release -I/home/arm/include -L//home/arm/lib -lpng -lts -lz-luuid -ljpeg" -qpe ''-xplatform linux-arm-g++ -edition pda -displaysize 320x240 -I/home/arm/include -L/home/arm/lib -prefix=/home/arm/qtopia''

解释: -I/ 是需要的头文件 –L/ 是需要连接的库文件,要增加触摸屏而且用到 tslib 的一定要加 -lts ,-prefix=/ 是设置安装路径的

(6)       make  编译通过以后 make install 然后把相应的库文件拷贝到 qtopia ,然后将 qtopia 整个文件一起拷贝到根文件系统中,利用 NFS 挂载测试。 记着设置环境变量

export QTDIR=/qtopia

export QPEDIR=/qtopia

export QWS_MOUSE_PROTO=TPanel:/dev/ts0 ( 这个根据自己的情况设定 )

export LD_LIBRARY_PATH=/qtopia/lib

export TSLIB_TSEVENTTYPE=H3600    tslib 中的设备结构体定义

export TSLIB_CONSOLEDEVICE=none tslib 运行需要的控制台,这里就是 LCD 屏幕 , 设定控制台设备为 none ,否则默认为 /dev/tty

export TSLIB_FBDEVICE=/dev/fb0   指定帧缓冲设备

export TSLIB_TSDEVICE=/dev/ts0 ( 这个根据自己的情况设定 )

export TSLIB_CALIBFILE=/etc/pointercal 指定触摸屏校准文件 pintercal 的存放位置

export TSLIB_CONFFILE=/etc/ts.conf 指定 TSLIB 设置文件的位置

export TSLIB_PLUGINDIR=$QTDIR/lib/ts 指定触摸屏插件所在路径

(7)       校准

#cd /qtopia/bin/tests

#./ts_calibrate

再运行测试

#./ts_test

运行 PDA

#cd ..

#./qpe

出现“ Tap anywhere to continue , 然后进行 qpe5 点校准,进入 qpe

 

(8)       建立一个脚本用来运行 qtopia ,在开发板的根目录 /bin 下建立 qpe.sh 文件,它用来设置环境变量,启动 qtopia ,内容如下:

#!/bin/sh

export HOME=/root

export QTDIR=/qtopia

export QPEDIR=/qtopia

export QWS_DISPLAY=LinuxFb:/dev/fb0

export QWS_KEYBOARD="TTY:/dev/tty1"

#export QWS_MOUSE_PROTO="USB:/dev/mouse0"

export QWS_MOUSE_PROTO="TPanel:/dev/ts0"

export PATH=$QPEDIR/bin:$PATH

export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH

export TSLIB_PLUGINDIR=$QTDIR/lib/ts

$QPEDIR/bin/qpe &

 

(9)       编译的时候出现的错误

kernel/qwsmouse_qws.cpp:63:19: tslib.h: No such file or directory

kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::openTs()'':

kernel/qwsmouse_qws.cpp:1773: error: `ts_open'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp:1773: error: (Each undeclared identifier is reported only once for each function it appears in.)

kernel/qwsmouse_qws.cpp:1780: error: `ts_config'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp:1784: error: `ts_fd'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::closeTs()'':

kernel/qwsmouse_qws.cpp:1793: error: `ts_close'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::readMouseData()'':

kernel/qwsmouse_qws.cpp:1855: error: aggregate `ts_sample sample'' has incomplete type and cannot be defined

kernel/qwsmouse_qws.cpp:1863: error: `ts_read'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::interpolateSample()'':

kernel/qwsmouse_qws.cpp:1882: error: elements of array `ts_sample samples[25]'' have incomplete type

kernel/qwsmouse_qws.cpp:1882: error: storage size of `samples'' isn''t known

kernel/qwsmouse_qws.cpp:1893: error: `ts_read_raw'' undeclared (first use this function)

kernel/qwsmouse_qws.cpp:1916: error: invalid application of `sizeof'' to incomplete type `ts_sample''

kernel/qwsmouse_qws.cpp:1920: error: invalid application of `sizeof'' to incomplete type `ts_sample''

kernel/qwsmouse_qws.cpp: In static member function `static int QTSLibHandlerPrivate::sortByX(const void*, const void*)'':

kernel/qwsmouse_qws.cpp:1931: error: invalid use of undefined type `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1931: error: forward declaration of `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1932: error: invalid use of undefined type `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1931: error: forward declaration of `const struct ts_sample''

kernel/qwsmouse_qws.cpp: In static member function `static int QTSLibHandlerPrivate::sortByY(const void*, const void*)'':

kernel/qwsmouse_qws.cpp:1942: error: invalid use of undefined type `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1942: error: forward declaration of `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1943: error: invalid use of undefined type `const struct ts_sample''

kernel/qwsmouse_qws.cpp:1942: error: forward declaration of `const struct ts_sample''

kernel/qwsmouse_qws.cpp: At global scope:

kernel/qwsmouse_qws.cpp:1624: warning: unused parameter ''mouseDev''

kernel/qwsmouse_qws.cpp:1624: warning: unused parameter ''mouseDev''

kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::interpolateSample()'':

kernel/qwsmouse_qws.cpp:1882: error: storage size of `samples'' isn''t known

kernel/qwsmouse_qws.cpp: At global scope:

kernel/qwsmouse_qws.cpp:160: warning: ''void limitToScreen(QPoint&)'' defined but not used

make[1]: *** [tmp/release-shared-linux-arm-g++-no-keypad/kernel/qwsmouse_qws.o] Error 1

make[1]: Leaving directory `/root/2410s/qtopia-free-2.2.0/qt2/src''

解决: tslib/src 目录下的 tslib.h tslib-filter.h tslib-private.h 拷贝到如下目录:

/root/2410s/qtopia-free-2.2.0/qtopia/include.

1:tsdev (compaq touchscreen emulation) is scheduled for removal.

See Documentation/feature-removal-schedule.txt for details.

这句是内核发出的,在 drivers/input/Tsdev.c   tsdev_open()

2: option `module_raw'' not recognized

3: Cannot configure touchscreen /dev/ts0 (No such file or directory)

  qt2/src/kernel/qwsmouse_qws.pp openTs() 发出的

  解决:将 plugins 拷贝到根文件系统,正确指定 export TSLIB_PLUGINDIR

4: Couldnt load module input

No raw modules loaded.

ts_config: Success

解决:正确设置 TSLIB_PLUGINDIR ,而且要在 /etc/profile 中设置

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
QtopiaQt Creator是两个不同的概念。Qtopia是Trolltech公司(现已被Digia收购)为采用嵌入式Linux操作系统的消费电子设备而开发的综合应用平台,包含完整的应用层、灵活的用户界面、窗口操作系统、应用程序启动程序以及开发框架。而Qt Creator是Qt的集成开发环境(IDE),用于开发Qt应用程序。Qt Creator提供了一套工具和功能,使开发者可以轻松地编写、调试和部署Qt应用程序。所以,QtopiaQt Creator可以说是在不同层面上为Qt开发提供支持的工具和框架。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [QTQT/E,Qtopiaqt creator的联系与区别](https://blog.csdn.net/qq_23329691/article/details/79063908)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [各种Qt的区别——QtQt/Embeded,QtopiaQt Designer,Qt Creator](https://blog.csdn.net/xingsongyu/article/details/88028027)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值