首页| 论坛| 消息

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

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
step2. 配置选项并安装,也可以下载安装脚本qte_for_x86.sh:
#./configure \
-release \
-shared \
-no-largefile \
-qt-sql-sqlite \
-plugin-sql-sqlite \
-xmlpatterns \
-exceptions \
-svg \
-webkit \
-qt-zlib \
-qt-gif \
-qt-libtiff \
-qt-libpng \
-no-libmng \
-qt-libjpeg \
-make libs \
-make tools \
-nomake examples \
-nomake docs \
-no-nis \
-no-cups \
-no-iconv \
-no-dbus \
-no-openssl \
-xplatform qws/linux-x86-g++ \
-embedded \
-qt-freetype \
-depths 16 \
-qt-gfx-qvfb \
-no-gfx-transformed \
-no-gfx-multiscreen \
-no-gfx-vnc \
-no-gfx-linuxfb \
-qt-kbd-tty \
-no-kbd-usb \
-qt-kbd-qvfb \
-qt-mouse-pc \
-qt-mouse-qvfb \
-no-glib \
-feature-THREAD \
-feature-CONCURRENT \
-feature-SOUND \
-feature-EFFECTS \
-feature-QWS_MULTIPROCESS \
-silent
#make >log_make 2>&1
#make install >log_install 2>&1
step3. 设置环境变量(两种方法):
仅当前用户有效(其他用户无效):修改$HOME/.bash_profile,加入:
PATH=/usr/local/Trolltech/QtEmbedded-4.5.1/bin:$PATH
立即生效:
#source $HOME/.bash_profile
所有用户有效(包括root和普通用户): 修改/etc/profile,加入以下行(一般在最后一行添加):
export PATH=/usr/local/Trolltech/ QtEmbedded-4.5.1/bin:$PATH
立即生效:
#source /etc/profile
step4. 在PC机上运行Qt-Embedded程序的方法为: 使用Qt-Embedded for x86的Qt库来编译Qt-Embedded程序,然后使用Qt-x11的qvfb工具仿真调试。下面以demo程序为例,确保qmake来自/usr/local/Trolltech/QtEmbedded-4.5.1/bin:
# qmake -project
# qmake
# make
# qvfb &
# ./demo -qws


#1 [edgepoly 06-14 20:06]
我已经按楼上的一步步地做了
在编译 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 ..

回复 发表
主题 版块