• 8018阅读
  • 1回复

QT-embedded-4.5 for x86的安装和使用 [复制链接]

上一主题 下一主题
离线bhwbj
 
只看楼主 倒序阅读 楼主  发表于: 2009-06-11
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
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 1楼 发表于: 2009-06-14
我已经按楼上的一步步地做了

在编译 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 'QStyleOptionViewItem' with no type
books/bookdelegate.cpp: In constructor 'BookDelegate::BookDelegate(QObject*)':
books/bookdelegate.cpp:47: error: class 'BookDelegate' does not have any field named 'QSqlRelationalDelegate'
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:52: error: prototype for 'void BookDelegate::paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:58: error: candidate is: void BookDelegate::paint(QPainter*, int) const
books/bookdelegate.cpp: In member function 'void BookDelegate::paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:57: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp:75: error: 'drawFocus' was not declared in this scope
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:86: error: prototype for 'QSize BookDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:60: error: candidate is: QSize BookDelegate::sizeHint(int) const
books/bookdelegate.cpp: In member function 'QSize BookDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:91: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:96: error: prototype for 'bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, const QStyleOptionViewItem&, const QModelIndex&)' does not match any in class 'BookDelegate'
books/bookdelegate.h:64: error: candidate is: bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, int)
books/bookdelegate.cpp: In member function 'bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, const QStyleOptionViewItem&, const QModelIndex&)':
books/bookdelegate.cpp:99: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:113: error: prototype for 'QWidget* BookDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:67: error: candidate is: QWidget* BookDelegate::createEditor(QWidget*, int) const
books/bookdelegate.cpp: In member function 'QWidget* BookDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:116: error: 'QSqlRelationalDelegate' has not been declared
make: *** [bookdelegate.o] Error 1


望楼主能看一下,非常感谢!
快速回复
限100 字节
 
上一个 下一个