qt creator 文件移植到开发板上运行 的全过程

来源:互联网 发布:模拟经营单机 知乎 编辑:程序博客网 时间:2024/04/30 10:17
因为板子已经有qt库文件了 我们不进行移植qt库,
1 安装arm-linux-gcc交叉编译器
2 编译 qt4.7.1 源码(源码有点错自己google修改)
3 安装qtcreator
4 配置qt create的 debug 加入编译好的qt4.7.1 qmake 文件 rebuild
5 在qtcreator创建一个新工程,利用qt4.7.1编译 生成arm运行文件(qtcreator会显示permission denied )
6 利用 各种方式把这个生成的文件拷贝到你的开发板子上(ssh nfs 串口rz命令 sd卡)
7 创建一个qt运行程序脚本 hello.sh


#!/bin/sh
base1=qpe
pid=`/bin/pidof $base1`
if [ -n "$pid" ]; then
        killall $base1
fi

base2=qss
pid=`/bin/pidof $base2`
if [ -n "$pid" ]; then
        killall $base2
fi

base3=quicklauncher
pid=`/bin/pidof $base3`
if [ -n "$pid" ]; then
        killall  $base3
fi


base4=fluidlauncher
pid=`/bin/pidof $base4`
if [ -n "$pid" ]; then
        killall  $base4
fi

export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event2
export TSLIB_TSEVENTTYPE=H3600
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export QTDIR=/opt/qt-4.7.1/


export LD_LIBRARY_PATH=$QTDIR/plugins/qtopialmigrate/:$QTDIR/qt_plugins/imageformats/:$QTDIR/lib:/root/tslib/build/lib:$LD_LIBRARY_PATH
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/root/tslib/build/bin


if [ -c /dev/input/event2 ]; then
        export QWS_MOUSE_PROTO="Tslib:${TSLIB_TSDEVICE}"
        if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
                rm /etc/pointercal
                /root/tslib/build/bin/ts_calibrate
        fi
else
        export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
        >/etc/pointercal
fi
export QWS_KEYBOARD=TTY:/dev/tty1



FB_SIZE=$(cat /sys/class/graphics/fb0/virtual_size)

#export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
case "$FB_SIZE" in
800,480)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
480,272)
export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
;;
*)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
esac
#export QWS_DISPLAY=:1



export HOME=/root/QtE4Home

./filename -qws

复制上面代码,后面红色的filename 就填生成qt程序的名称
8 杀掉所有qt进程  利用ps命令查看 kill命令杀
9 运行这个脚本
0 0