開發(fā)平臺(tái):ubuntu 7.04
目標(biāo)平臺(tái):S3c2410
開發(fā)工具:arm 交叉工具鏈版本3.4.5
qt4版本:qt-embedded-linux-opensource-src-4.4.3.tar.gz(可到trolltech的ftp下載)
源碼版本:linux-2.6.8
一.
cd
make menuconfig
在界面中找到Graphics support
進(jìn)入查看Support for framebuffer devices 和 S3C2410 LCD framebuffer support兩個(gè)選項(xiàng)是否被選中,選中代表內(nèi)核已支持。否則選中兩個(gè)選項(xiàng),然后保存退出, make zImage
將新生成的內(nèi)核鏡像燒寫到開發(fā)板上。
二.
./configsh
(configsh腳本內(nèi)容如下:
#!/bin/sh
./configure -prefix /home/linux/qt4_port/qt/build\
)
make && make install
這個(gè)時(shí)候在指定的安裝目錄會(huì)出現(xiàn)如下目錄:bin include lib mkspecs plugins translations
三.
mount –t nfs –o nolock 192.168.1.100:/source/rootfs
然后將上一步生成的lib庫(kù)文件考到掛載的根文件系統(tǒng)的/home/qt/build/lib目錄下
cp /home/linux/qt4_port/qt/build/lib/libQt*
四.
cp /home/linux/qt4_port/qt/build/lib/fonts/wenquanyi_160_75.qpf \
/source/rootfs/home/qt/build/fonts
五. 用qt編一個(gè)helloworld 程序進(jìn)行測(cè)試。使用qmake、make對(duì)程序進(jìn)行編譯。
注意:一定要用qtembed安裝目錄下bin/下面的qmake
/home/linux/qt4_port/qt/build/bin/qmake
/home/linux/qt4_port/qt/build/bin/qmake
make
六.將上一步生成的可執(zhí)行文件helloworld考到掛載的根文件系統(tǒng)下
在開發(fā)板上設(shè)置環(huán)境變量
export QTDIR=/var/mnt /home/qt/build
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH
export QT_QWS_FONTDIR=/var/mnt /home/qt/build/fonts
最后運(yùn)行helloworld程序
./helloworld
就可以看到界面了。
聯(lián)系客服