首页| 论坛| 消息

标题:QT-embedded-4.5 for arm的安装和使用
作者:bhwbj
日期:2009-06-11 13:58
内容:

以下是详细的安装过程,如果想避免漫长的编译过程,可以下载已经编译安装好的压缩包QtEmbedded-4.5.1-arm.tar.gz,解压缩到/usr/local/Trolltech目录下(若无Trolltech则创建此目录),直接从step3开始。
# tar zxvf QtEmbedded-4.5.1-arm.tar.gz -C /usr/local/Trolltech
完整安装过程:
step1. 将qt-embedded-linux-opensource-src-4.5.1.tar.gz拷贝到Linux下,解压缩:
# tar zxvf qt-embedded-linux-opensource-src-4.5.1.tar.gz
# cd qt-embedded-linux-opensource-src-4.5.1
修改qt-embedded-linux-opensource-src-4.5.1/src/gui/embedded/qmouselinuxtp_qws.h,在头文件处加入:
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW
step2. 配置选项并安装,也可以下载安装脚本qte_for_arm.sh:
#./configure \
-embedded arm \
-qt-sql-sqlite \
-plugin-sql-sqlite \
-no-scripttools \
-no-nis \
-exceptions \
-xmlpatterns \
-no-largefile \
-no-libmng \
-no-accessibility \
-depths 16 \
-nomake docs \
-make tools \
-make libs \
-qt-zlib \
-feature-THREAD \
-feature-CONCURRENT \
-feature-SOUND \
-feature-EFFECTS \
-feature-QWS_MULTIPROCESS \
-silent > log_cfg 2>&1
#make && make install
step3. 设置环境变量(两种方法):
仅当前用户有效(其他用户无效):修改$HOME/.bash_profile,加入:
PATH=/usr/local/Trolltech/QtEmbedded-4.5.1-arm/bin:$PATH
立即生效:
#source $HOME/.bash_profile
所有用户有效(包括root和普通用户): 修改/etc/profile,加入以下行(一般在最后一行添加):
export PATH=/usr/local/Trolltech/ QtEmbedded-4.5.1-arm/bin:$PATH
立即生效:
#source /etc/profile
step4. 要移植Qt-embedded到开发板上,需要拷贝的Qte基本库文件、图片插件库和字体文件:
1) QtEmbedded-4.5.1-arm/lib/libQtGui.so.4.5.1
2) QtEmbedded-4.5.1-arm/lib/libQtNetwork.so.4.5.1
3) QtEmbedded-4.5.1-arm/lib/libQtCore.so.4.5.1
4) QtEmbedded-4.5.1-arm/lib/libQtSql.so.4.5.1
5) QtEmbedded-4.5.1-arm/plugins/imageformats
6) QtEmbedded-4.5.1-arm/lib/fonts
在Linux PC上建立文件夹,将上述文件拷入:
#mkdir opt qt lib plugins
#mv plugins qt
#mv lib qt
#mv qt opt
#c ..


#1 [goonman 06-11 16:18]
太感谢了!顺便问一下,那可以下载到已经编译好的压缩包。
#2 [bhwbj 06-12 11:08]
唔,在公司的服务器上。。。
#3 [edgepoly 06-14 20:08]
我已经按楼上的一步步地做了
在编译 demos 出现了以下错误:

好慢啊,今天花了一个下午把Qt -embedded 编译好了
在编译demos 时发现错误:

arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/qws/linux-arm-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iaffine -Ishared -Ideform -Igradients -Ipathstroke -Icomposition -Ibooks -Iboxes -Iboxes/3rdparty -Ibrowser -Ichip -Iembeddeddialogs -Iinterview -Imacmainwindow -Imainwindow -Imediaplayer -Iqtdemo -Ispreadsheet -Isqlbrowser -Itextedit -Iundo -Iembedded/embeddedsvgviewer -Iembedded/fluidlauncher -Iembedded/styledemo -I. -I. -o bookdelegate.o books/bookdelegate.cpp
In file included from books/bookdelegate.cpp:42:
books/bookdelegate.h:48:34: error: QSqlRelationalDelegate: No such file or directory
In file included from books/bookdelegate.cpp:42:
books/bookdelegate.h:53: error: expected class-name before '{' token
books/bookdelegate.h:57: error: expected ',' or '...' before '&' token
books/bookdelegate.h:58: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:60: error: expected ',' or '...' before '&' token
books/bookdelegate.h:60: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:63: error: expected ',' or '...' before '&' token
books/bookdelegate.h:64: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:66: error: expected ',' or '...' before '&' token
books/bookdelegate.h:67: error: ISO C++ forbids declaration of 'QStyleOp ..
#4 [bhwbj 06-15 10:39]
QSqlRelationalDelegate error,可能是跟数据库有关。是在configure的时候一起编译的demos还是都编译好后才编的?
#5 [bhwbj 06-15 10:44]
我记得我好像是-nomake-demos。如果我需要跑跑demos,再单独编哪个例子。
在Makefile里加入-I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtSql
-lQtSql
看看有用没。

<< 1 2 3 >> (1/5)

回复 发表
主题 版块