本qt4.5.3移植基于海思3515C芯片
1、准备工作
开发环境:UBuntu10.04
交叉编译工具:arm-hisiv100nptl-linux-gcc(gcc version 4.4.1)
下载qt-embedded-linux-opensource-src-4.5.3.tar源码,
下载地址:ftp://ftp.qt.nokia.com/qt/source/
将源码复制到/root/hixx/目录下
进入源码包所在目录,并解压源码:#tar -xvzf qt-embedded-linux-opensource-src-4.5.3.tar.gz
配置交叉编译工具,在海思提供的sdk中已有配置脚本,直接运行即可。
2、编译源码
2.1指定编译器类型:进入源码目录,#gedit mkspecs/qws/linux-arm-g++/qmake.conf .将其中所有的arm-linux全部替换成arm-hisiv100nptl-linux。
2.2执行configure进行配置
./configure -prefix /root/hixx/4.5.3 -release -opensource -shared -fast -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -no-largefile -exceptions -no-accessibility -qt-sql-sqlite -no-qt3support -no-xmlpatterns -phonon -no-svg -no-webkit -no-mmx -no-3dnow -no-sse -no-sse2 -qt-zlib -qt-gif -qt-libtiff -qt-libjpeg -qt-libmng -no-openssl -make libs -nomake examples -nomake docs -nomake demo -no-nis -no-cups -iconv -pch -dbus -depths 16 -opengl -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-usb -no-kbd-qvfb -no-glib -armfpa
配置根据实际的需要进行配置
主要配置说明如下:
-prefix /root/hixx/4.5.3 -release 指定qt安装目录
-xplatform qws/linux-arm-g++ 交叉编译的目标平台,一般来说根据你所要移植的目标板来确定
-embedded arm 嵌入式平台架构选择,可以选择arm,mips,x86及generic,视你的目标平台决定吧
configure配置选项参数的说明:http://blog.youkuaiyun.com/chenyong19870904/article/details/6712409
2.3#make (编译源码)
2.4#make install (此步完成后可在/root/hixx/4.5.3路径下看到编译好的qt)
3.运行qt程序
3.1将开发板挂载/root/hixx/nfs/目录下:mount -t nfs -o nolock 192.168.1.199:/root/hixx/nfs nfs
3.2将编译好的q路径下的lib、plugins文件夹拷贝到挂载目录下
3.3设置开发板/etc/profile中的环境变量,添加以下内容
export QTDIR=/tmp/nfs/qte
export PATH=$QTDIR/bin:$PATH
export TSLIB_CONSOLEDEVICE=none
export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib
export QT_QWS_FONTDIR=/tmp/nfs/qte/lib/fonts
最后source /etc/profile使环境变量生效
3.4在运行qt程序时必须应先打开framebuffer设备文件,可以先运行海思提供的framebuffer演示demo程序
./sample_hifb & //程序后台执行
我们的目的是打开framebuffer设备文件 ,自行写个小程序也行。
如果没有连接液晶屏啧会出错:open /dev/fb0 failed!
3.5运行qt测试程序helloword #./helloword -qws
10/09 cmj
2421





