ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装
来源:互联网 发布:网络散布谣言怎么定罪 编辑:程序博客网 时间:2024/04/29 18:48
笔记本: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/tslibexport TSLIB_TSDEVICE=/dev/input/event0export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATHexport 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/bashTARGET_DIR=$PWDcd /list=`cat << EOFusr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/widgets/wiggly/wigglyusr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/painting/concentriccircles/concentriccirclesusr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/unifont_160_50.qpfusr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6.3usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/sqldrivers/libqsqlite.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblewidgets.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblecompatwidgets.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/iconengines/libqsvgicon.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqico.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqsvg.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqtiff.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqjpeg.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqmng.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqgif.sousr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/deformusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/pathdeform.htmlusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/spheres.svgusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/embeddedsvgviewerusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/shapes.svgusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/default.svgusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/v-slider-handle.svgusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/deform.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flightinfo_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/raycasting.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/digiflip.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/mediaplayer.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/weatherinfo.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/concentriccircles.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/context2d_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/lightmaps.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/elasticnodes.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/ftp_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/anomaly_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flickable.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/softkeys_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/pathstroke.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_4.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_1.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_2.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_6.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_3.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_5.pngusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/fluidlauncherusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/config.xmlusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/styledemo/styledemousr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstroke.htmlusr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstrokeEOF`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/
开发板自带QT程序设置禁止开机启动
1、[root@FriendlyARM /]# vi /etc/init.d/rcS 2、将/bin/qtopia &注释掉(用 “ # ” 号)
- ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装
- ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装
- ubuntu14.04下安装配置Qt4.8.6
- mini2440中执行自己编写的QT4程序时 qt4脚本
- Samba服务器的安装与配置(Ubuntu14.04)
- QT4.3.4+Eclipse3.3+MinGW的安装与配置
- Ubuntu arm-qt4.8.5 的安装与配置
- ubuntu14.04安装qt4.8.6
- ubuntu14.04安装QT4.7.4
- mini2440 qt4 移植转)
- arm9 mini2440 10道面试题
- Ubuntu12.04下配置安装Qt4.6.3 及移植到mini2440开发板及其使用全过程
- Ubuntu12.04下配置安装Qt4.6.3 及移植到mini2440开发板及其使用全过程
- Ubuntu12.04下配置安装Qt4.6.3 及移植到mini2440开发板及其使用全过程
- Ubuntu14.0.4系统下 SVN的安装与配置
- Ubuntu14.04下Vim的安装与配置
- Linux(Ubuntu14.04)下HelixServer的安装与配置
- Ubuntu14.04下ROS的安装与配置
- 常用开源控件
- android开发 NDK 编译和使用静态库、动态库
- Python GET或者POST 请求
- C++primer plus第六版课后编程题答案18.3
- java重构学习3:以查询代替临时变量(Replace Temp with Query)
- ubuntu14.10+QT4编写ARM9(mini2440)应用的配置与安装
- 关于win8.1 安装android驱动失败的缘由
- arm-eabi-addr2line android应用崩溃的调试方法
- java equals hashCode
- 碎片话的经济
- Jenkins进阶系列之——14配置Jenkins用户和权限
- php 封装PDO类
- 循环水处理剂:电厂循环水处理剂介绍
- android Service stopSelf(int startId)与stopSelf()的区别