IT技术互动交流平台

ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装

来源:IT165收集  发布日期:2014-12-21 19:49:43

笔记本:ubuntu14.10(32位)

ARM9开发板:mini2440(友善之臂提供的Superboot2440、zImage_T35、rootfs_qtopia_qt4镜像文件,通过minitools烧写进开发板)

交叉编译:arm-linux-gcc-4.4.3

开发所需工具:minicom、u盘

博客地址:http://blog.csdn.net/muyang_ren

tslib

一、下载地址:http://download.csdn.net/detail/muyang_ren/8280977

解压安装(要在root用户下):

1、# tar -zxvf tslib-1.4.tar.gz

2、# cd /tslib

3、# ./autogen.sh

4、#echo "ac_cv_func_malloc_0 _nonnull=yes">arm-linux.cache

5、#./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes

6、# make

7、# make install

8、#vi /usr/local/tslib/etc/ts.conf 把第二行的#号去掉

9、# tar zcvf tslib.tar.gz /usr/local/tslib/ 压缩

10、[root@FriendlyARM tslib]# tar zxvf tslib.tar.gz -C /usr/local/ 通过u盘将tslib.tar.gz复制到开发板,解压,目录与pc端一致(保持一致)

二、进入arm开发板设置/etc/profile

1、#vi /etc/profile

2、新增以下内容

export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event0
export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH
export TSLIB_FBDEVICE=/dev/fb0                         
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts              
export TSLIB_CONSOLEDEVICE=none                        
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf          
export POINTERCAL_FILE=/etc/pointercal                 
export TSLIB_CALIBFILE=/etc/pointercal                 
export QWS_MOUSE_PROTO='TSLIB:/dev/input/event0'

3、# source /etc/profile

4、#./ts_calibrate //运行示例程序

出现的问题:

1、./autogen.sh: 4: autoreconf: not found

是在不同版本的 tslib 下执行 autogen.sh 产生。它们产生的原因一样,是

因为没有安装automake 工具

sudo apt-get install autoconf automake libtool

安装、配置qt4.6.3-ARM版库

1、解压源代码:#tar -zvxf qt-everywhere-opensource-src-4.6.3.tar.gz

2、# cd qt-everywhere-opensource-src-4.6.3/

3、# ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp

4、# make&&make install

5、# ./mktarget

6、# export QTDIR=/usr/local/Trolltech/QtEmbedded-4.6.3-arm

7、# export PATH=$QTDIR/bin:$PATH

8、# export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/lib/plugins:/usr/local/lib:$LD_LIBRARY


mktarget 文件内容:

#!/bin/bash

TARGET_DIR=$PWD
cd /
list=`cat << EOF
usr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/widgets/wiggly/wiggly
usr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/painting/concentriccircles/concentriccircles
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/unifont_160_50.qpf
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6.3
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/sqldrivers/libqsqlite.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblewidgets.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblecompatwidgets.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/iconengines/libqsvgicon.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqico.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqsvg.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqtiff.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqjpeg.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqmng.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqgif.so
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/deform
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/pathdeform.html
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/spheres.svg
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/embeddedsvgviewer
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/shapes.svg
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/default.svg
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/v-slider-handle.svg
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/deform.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flightinfo_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/raycasting.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/digiflip.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/mediaplayer.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/weatherinfo.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/concentriccircles.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/context2d_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/lightmaps.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/elasticnodes.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/ftp_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/anomaly_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flickable.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/softkeys_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/pathstroke.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_4.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_1.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_2.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_6.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_3.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_5.png
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/fluidlauncher
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/config.xml
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/styledemo/styledemo
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstroke.html
usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstroke
EOF
`
tar cfvz $TARGET_DIR/target-qte-4.6.3.tgz  $list

1、将压缩文件 target-qte-4.6.3.tgz copy到u盘

开发板端接上u盘上电:

1、[root@FriendlyARM /]# cd /udisk/

2、[root@FriendlyARM /]# tar xvzf target-qte-4.6.3.tgz -C /


注意:

我之前没压缩打包(使用mktarget脚本文件),直接将lib文件通过nfs传输到开发板,结果都只能传输少量的文件过去,可能是不支持传送太多零散文件,压缩打包,u盘挂载也很快的!

测试qt库

PC端:

1、# cd ../examples/widgets/calculator

2、# qmake -project

3、# qmake

4、# make

开发板端:

配置:

1、#export TSLIB_TSDEVICE=/dev/input/event0

2、#export LD_LIBRARY_PATH=/usr/local/tslib/lib/:$LD_LIBRARY_PATH

3、#export TSLIB_FBDEVICE=/dev/fb0

4、#export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts

5、#export TSLIB_CONSOLEDEVICE=none

6、#export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf

7、#export POINTERCAL_FILE=/etc/pointercal

8、#export TSLIB_CALIBFILE=/etc/pointercal

9、#export QWS_MOUSE_PROTO="TSLIB:/dev/input/event0'

10、#export QTDIR=/usr/local/Trolltech/QtEmbedded-4.6.3-arm

11、#export PATH=$QTDIR/bin:$PATH

12、#export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/lib/plugins:/usr/local/lib:$LD_LIBRARY


将计算器示例程序calculator通过u盘下载到开发板

13、# calculator -qws //没-qws是会报错的


提示:ctrl+c 可以中断操作


安装PC端QT Creator


1、# chmod a+x qt-sdk-linux-x86-opensource-2010.05.1.bin

2、# ./qt-sdk-linux-x86-opensource-2010.05.1.bin

选项默认

QT Creator设置:

1、qmake路径设置:

PC端QT Creator编写简单程序并模拟运行


新建工程


注意:

“PATH中的QT”是pc端运行的环境,如果没有勾选后,pc端运行程序会出现错误:启动程序失败,路径或者权限错误?

“QT-E-4.6.3”是之前添加的qmake路径,感觉没什么用,因为开发板上的程序需要自己用命令qmake、make。

QT Creator只是一个编写代码的环境和模拟运行的作用!

添加简单框框:


运行:


出现模拟界面,但是可以到项目目录里看,没有产生makefile和二进制可执行文件

编写代码和模拟运行就完成了,下面是编译出开发板可自行文件。

编译出开发板的可执行文件

pc端

1、进入项目目录

# cd /项目路径


2、qmake生成项目makefile文件

# /qmake路径/qmake


3、make编译出二进制可执行文件

# make


4、生成的可自行文件通过u盘运行到开发板


开发板端

1、运行命令

# /文件路径 -qws //(ctrl+c)可以中断运行

汉化(需重启才能新建项目)

汉化下载地址:http://download.csdn.net/detail/muyang_ren/8280849

1、# tar zxvf QtCreator2.0.1汉化.tar.gz

2、# cd QtCreator2.0.1汉化/

3、# cp qtcreator_zh_CN.qm /opt/qtsdk-2010.05/share/qtcreator/translations/


延伸阅读:

  • 专题推荐

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规