QT嵌入式环境搭建与移植

本文介绍了如何在Linux环境下编译Qt4.6.3的不同版本,包括PC版、x86嵌入式版和ARM版,并详细说明了在Fedora7系统中搭建Qt Creator开发环境的过程,以及遇到问题时的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

分类: LINUX

一、Qt4.6.3PXA270

帮助文档),USB串口,软件准备:

1、用于 Linux/X11 32 1.1 编译

 qt-everywhere-opensource-src-4.6.3.tar.gz 压缩包解压为3,嵌入式 x86 三个版本。

root,分别命名为pc1.1.1编译 PC 

进入pc1.1.2编译嵌入式x86目录,执行如下操作:

# ./configure -embedded x86 -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb

# gmake

# gmake install

安装过程比较长,没有碰到过错误。

编译安装PC

进入pc/tools/qvfb/目录,执行如下操作:

#make

编译完毕,将pc/bin1.1.3编译嵌入式、编辑/root/.bashrc文件,在最后一行加上 export PATH=/usr/local/arm/3.4.1/bin:/$PATH

3参数, 不然安装后不在QtEmbedded-4.6.3-arm文件夹下,而是覆盖了QtEmbedded-4.6.3

# ./configure \

-prefix /usr/local/Trolltech/QtEmbedded-4.6.3-arm \ 

-opensource \

-confirm-license \

-release -shared \

-embedded arm \

-xplatform qws/linux-arm-g++ \

-depths 16,18,24 \

-fast \

-optimized-qmake \

-pch \

-qt-sql-sqlite \

-qt-libjpeg \

-qt-zlib \

-qt-libpng \

-qt-freetype \

-little-endian -host-little-endian \

-no-qt3support \

-no-libtiff -no-libmng \

-no-opengl \

-no-mmx -no-sse -no-sse2 \

-no-3dnow \

-no-openssl \

-no-webkit \

-no-qvfb \

-no-phonon \

-no-nis \

-no-opengl \

-no-cups \

-no-glib \

-no-xcursor -no-xfixes -no-xrandr -no-xrender \

-no-separate-debug-info \

-nomake examples -nomake tools -nomake docs \

 

4目录中有三个文件夹:Qt-4.6.31.2移植

Fedora7中的所有文件复制到ARM /flash/qt/libFedora7  /usr/local/Trolltech/QtEmbedded-4.6.3-arm/bin  /usr/local/Trolltech/QtEmbedded-4.6.3-arm/include中的所有文件复制到ARM目录中;

Fedora7 /flash/qt/fonts目录中;

 

二、Fedora7下搭建Qt Creator开发环境  安装Qt-creator-1.3.1

1、进入目录/root/tmp

设置qt-creator-linux-x86-opensource-1.3.1.bin文件为可执行

#chmod +x qt-creator-linux-x86-opensource-1.3.1.bin

3打开Options窗口。

3、在Options界面左侧,点击Qt4--->Qt Versions的版本名,区分各个版本即可(如pc版取Qt4.6.3-pcx86版取QtE4.6.3-x86arm版取QtE4.6.3-arm)。

单击Qmake Location,右侧Browse按钮,在弹出的Select QMake Executable程序(按照我们前面安转的,

pc版路径:/usr/local/Trolltech/QtEmbedded-4.6.3/ bin/qmake

arm示例

usr/local/Trolltech/QtEmbedded-4.6.3/demos下复制books例程到root/tmp文件夹下。

启动Qt-creatorFile--->Open File or Project下的编译与调试

Qt-creator界面左侧点击Projects图标,打开工程设置界面,执行如下操作:

1、配置:

Edit Project Settings for Project books--->Build Settings--->Edit Build Configuration弹出对话框单击Ok按钮,在

Edit Build Configuration;下会出现蓝色的Make QtE4.6.3-x86 Release active.字符,单击激活

QtE4.6.3-x86 Release

Run Settings--->Edit run configurationbooksbooks,启动Qvfb

6、回到Qt-creatorBuild--->Run:选择Debug项,则调试启动速度比Release时的要快很多。

2.2.2 arm的文件系统的某个目录下,直接把books文件夹复制过去。

2、运行及错误处理:

minicom下面,ps,比如1234,然后通过kill 1234,此时就会出现前面讲到的relocation error: /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so.4: symbol powf, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with link time reference错误。

3、解决办法

进入主机/opt/toolchains/arm920t-eabi/arm-angstrom-linux-gnueabi/lib目录下找到libstdc++.so.6

 

<span style="font-family: 宋体; font-size: 10.5pt;" times="" new="" roman";="" mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:"times="" mso-bidi-font-family:arial;color:#333333;background:white;mso-font-kerning:="" 0pt;mso-ansi-language:en-us;mso-fareast-language:zh-cn;mso-bidi-language:ar-sa"="">然后再运行./books –qws,看问题是不是解决了!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值