嵌入式QT4.7移植

第一步 编译tslib

 

cd tslib
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache -prefix=/usr/local/tslib
make
make install

 

 

第二步 编译QT4.7的各种版本

ARM版

 

解压qt-everywhere-opensource-src-4.7.0.tar.gz,并拷贝出三份,分别命名成qt-4.7.0-arm、qt-4.7.0-x86、qt-4.7.0-pc
cd qt-4.7.0-arm
./configure -prefix /usr/local/Trolltech/qt-4.7.0-arm -opensource -confirm-license -release -shared -embedded arm -xplatform qws/linux-arm-g++ -no-qt3support -fast -no-largefile -qt-mouse-tslib -I /usr/local/tslib/include -L /uar/local/tslib/lib -make tools -make demos -make examples -make docs -qt-libjpeg -qt-libpng -qt-libtiff -qt-gif -multimedia
make
make install

 

1.使用4.3.3交叉编译器出现以下错误:
../3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp: In function 'void* TrySbrk(size_t, size_t*, size_t)':
../3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp:126: error: 'sbrk' was not declared in this scope
make[1]: *** [obj/release/TCSystemAlloc.o] Error 1
make[1]: Leaving directory `/home/bakul/Qt/qt-everywhere-opensource-src-4.6.3/src/script'
make: *** [sub-script-make_default-ordered] Error 2
解决方法:
    到目录/usr/local/arm/4.3.3/arm-none-linux-gnueabi/libc/usr/include下打开unistd.h头文件,第996行注释的内容反注释,
extern void *sbrk (intptr_t __delta) __THROW;
后来又改成:
extern void *sbrk (size_t __delta) __THROW;
不知道为什么,把这个函数的引用的给注释掉了,希望高手解析一下。继续编译,再也没有这个错误提示。

 

X86版

 

cd qt-4.7.0-x86
./configure -prefix /usr/local/Trolltech/qt-4.7.0-x86 -opensource -confirm-license -embedded x86 -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb -make tools
make
make install

 

 

PC版

 

cd qt-4.7.0-pc
./configure -prefix /usr/local/Trolltech/qt-4.7.0-pc -opensource -confirm-license
make
make install

 

第三步 编译qvfb

 

接下来安装PC版本的qvfp
cd qt-4.7.0-pc
cd tools/qvfp
make
cp qt-4.7.0-pc/bin/qvfp /usr/local/Trolltech/qt-4.7.0-x86/bin
make

至此安装完成

 

 

第四步 设置QTCreater

 

 

把usr/local/Trolltech/qt-4.7.0-x86/examples/widgits/calculator文件夹复制到root/tmp文件夹下
启动QtCreator,File-->Open File or Project...,打开root/tmp/calculator/calculator.pro
这里我们分两部分,首先编译x86下的,并运行在qvfb下,再编译arm下的,最后移到开发板下运行。
x86下的编译与调试
1.在QtCreator界面左侧点击Projects图标,打开工程设置界面。
2.在Edit Project Settings for Project calculator-->Build Settings-->Edit Build Configuration;单击Add,在下拉列表中选择Using Qt Version “x86”弹出对话框单击Ok按钮,在Edit Build Configuration:下会出现蓝色的Make x86 Release active.字符,单击激活x86 Release。
3.在Run Settings-->Edit run configuration;右侧单击Show Details按钮,在打开的下拉列表中Arguments;文本框中添加参数“-qws”
4.设置完毕,点击Edit图标,回到编辑界面。
5.编译:在Build菜单下,先Clean Project “calculator”,然后Build Project “calculator”,在右下角Compile Output窗口能看到编译信息
6.运行:
启动终端,输入/usr/local/Trolltech/qt-4.7.0-x86/bin/qvfb -width 800 -height 480 &,启动qvfb
回到QtCreator,Build-->Run,运行程序,切换我们的qvfb窗口中,就可以看到calculator的运行界面了

 

 

第五步 制作适合嵌入式系统的字库文件

 

把windows下的simhei.ttf拷贝到lib下的fonts目录中

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值