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

目录(?)[+]

笔记本: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、新增以下内容

[cpp]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. export TSLIB_ROOT=/usr/local/tslib  
  2. export TSLIB_TSDEVICE=/dev/input/event0  
  3. export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH  
  4. export TSLIB_FBDEVICE=/dev/fb0                           
  5. export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts                
  6. export TSLIB_CONSOLEDEVICE=none                          
  7. export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf            
  8. export POINTERCAL_FILE=/etc/pointercal                   
  9. export TSLIB_CALIBFILE=/etc/pointercal                   
  10. 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 文件内容:

[cpp]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. #!/bin/bash  
  2.   
  3. TARGET_DIR=$PWD  
  4. cd /  
  5. list=`cat << EOF  
  6. usr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/widgets/wiggly/wiggly  
  7. usr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/painting/concentriccircles/concentriccircles  
  8. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6.3  
  9. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6  
  10. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6.3  
  11. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4  
  12. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4  
  13. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so  
  14. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6.3  
  15. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4  
  16. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so  
  17. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so  
  18. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6.3  
  19. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4.6.3  
  20. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so  
  21. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4  
  22. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4  
  23. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6  
  24. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6  
  25. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts/unifont_160_50.qpf  
  26. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4.6  
  27. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4  
  28. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6  
  29. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6.3  
  30. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6  
  31. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so  
  32. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so.4.6  
  33. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6  
  34. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4.6.3  
  35. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSql.so.4.6  
  36. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4  
  37. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so  
  38. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so.4.6.3  
  39. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtTest.so.4  
  40. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4.6.3  
  41. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so  
  42. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so.4.6  
  43. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so  
  44. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtXml.so.4  
  45. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtCore.so.4  
  46. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScriptTools.so.4.6.3  
  47. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtNetwork.so.4.6.3  
  48. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtMultimedia.so  
  49. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtScript.so  
  50. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4.6  
  51. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQt3Support.so  
  52. usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtSvg.so.4  
  53. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/sqldrivers/libqsqlite.so  
  54. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblewidgets.so  
  55. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/accessible/libqtaccessiblecompatwidgets.so  
  56. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/iconengines/libqsvgicon.so  
  57. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqico.so  
  58. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqsvg.so  
  59. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqtiff.so  
  60. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqjpeg.so  
  61. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqmng.so  
  62. usr/local/Trolltech/QtEmbedded-4.6.3-arm/plugins/imageformats/libqgif.so  
  63. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/deform  
  64. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/deform/pathdeform.html  
  65. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/spheres.svg  
  66. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/embeddedsvgviewer  
  67. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/shapes.svg  
  68. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/default.svg  
  69. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/embeddedsvgviewer/files/v-slider-handle.svg  
  70. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer.png  
  71. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.png  
  72. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/deform.png  
  73. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flightinfo_s60.png  
  74. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/raycasting.png  
  75. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/digiflip.png  
  76. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo.png  
  77. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/styledemo_s60.png  
  78. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/mediaplayer.png  
  79. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/weatherinfo.png  
  80. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/concentriccircles.png  
  81. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/context2d_s60.png  
  82. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly.png  
  83. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/lightmaps.png  
  84. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/elasticnodes.png  
  85. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/wiggly_s60.png  
  86. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/ftp_s60.png  
  87. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.png  
  88. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/anomaly_s60.png  
  89. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/flickable.png  
  90. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/softkeys_s60.png  
  91. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.png  
  92. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.png  
  93. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/screenshots/pathstroke.png  
  94. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_4.png  
  95. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_1.png  
  96. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_2.png  
  97. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_6.png  
  98. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_3.png  
  99. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/slides/demo_5.png  
  100. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/fluidlauncher  
  101. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/fluidlauncher/config.xml  
  102. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/embedded/styledemo/styledemo  
  103. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstroke.html  
  104. usr/local/Trolltech/QtEmbedded-4.6.3-arm/demos/pathstroke/pathstroke  
  105. EOF  
  106. `  
  107. 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 &注释掉(用 “ # ” 号)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值