笔记本:ubuntu14.10(32位)
ARM9开发板:mini2440(友善之臂提供的Superboot2440、zImage_T35、rootfs_qtopia_qt4镜像文件,通过minitools烧写进开发板)
交叉编译:arm-linux-gcc-4.4.3
开发所需工具:minicom、u盘
解压安装(要在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
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盘挂载也很快的!
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 可以中断操作
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路径设置:
2、新建工程
汉化下载地址: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/
ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装
原文地址:http://blog.csdn.net/muyang_ren/article/details/42004427