1. 程式人生 > >qt creator 檔案移植到開發板上執行 的全過程

qt creator 檔案移植到開發板上執行 的全過程

因為板子已經有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 執行這個指令碼