• 17057阅读
  • 25回复

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

上一主题 下一主题
离线bhwbj
 
只看楼主 倒序阅读 楼主  发表于: 2009-06-11
以下是详细的安装过程,如果想避免漫长的编译过程,可以下载已经编译安装好的压缩包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

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib/libQtGui.so.4.5.1 opt/qt/lib

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib/libQtNetwork.so.4.5.1 opt/qt/lib

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib/libQtCore.so.4.5.1 opt/qt/lib

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib/libQtSql.so.4.5.1 opt/qt/lib

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/plugins/imageformats opt/qt/plugins

#cp /usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib/fonts opt/qt/lib

然后创建库链接:

ln -s opt/qt/lib/libQtGui.so.4.5.1 opt/qt/lib/libQtGui.so.4

ln -s opt/qt/lib/libQtCore.so.4.5.1 opt/qt/lib/libQtCore.so.4

ln -s opt/qt/lib/libQtNetwork.so.4.5.1 opt/qt/lib/libQtNetwork.so.4

ln -s opt/qt/lib/libQtSql.so.4.5.1 opt/qt/lib/libQtSql.so.4

step5. 将opt/qt 加入到开发板根文件系统 中,然后通过tftp方式将此根文件系统烧写进开发板。

step6. 在开发板上设置环境变量:

#export set QTDIR=/opt/qt

#export PATH=$QTDIR:$PATH

#export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH

#export QT_PLUGIN_PATH=$QTDIR/plugins/

#export QT_QWS_FONTDIR=$QTDIR/lib/fonts

#export set QWS_MOUSE_PROTO=LinuxTP:/dev/h3600_tsraw

step7. 初次使用触摸屏还需要校正,到安装源目录qt-embedded-linux-opensource-src-4.5.1/examples/qws/mousecalibration下

#qmake -project

#qmake

#make

将生成的mousecalibration拷到开发板上运行,进行五点校正。

step8. 将Qt-Embedded程序运行在目标板上: 用Qt-Embedded for arm的库编译Qt-Embedded应用程序,以demo为例,确保qmake是来自/usr/local/Trolltech/QtEmbedded-4.5.1-arm/bin:

# qmake -project

# qmake

# make

将得到的demo程序下载到目标板上,在运行程序前以下环境变量必须已经设置:

export QTDIR=/opt/qt:$QTDIR

export PATH=$QTDIR:$QTDIR/plugins:$PATH

export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH

export set QWS_MOUSE_PROTO=LinuxTP:/dev/h3600_tsraw

export QT_PLUGIN_PATH=$QTDIR/plugins/

export QT_QWS_FONTDIR=$QTDIR/lib/fonts

export QWS_DISPLAY=LinuxFb:/dev/fb0

export QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0"

export QWS_SIZE=800x480

然后在目标板的终端上输入:

#./demo -qws

即可运行。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线goonman

只看该作者 1楼 发表于: 2009-06-11
太感谢了!顺便问一下,那可以下载到已经编译好的压缩包。
离线bhwbj
只看该作者 2楼 发表于: 2009-06-12
唔,在公司的服务器上。。。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 3楼 发表于: 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


望楼主能看一下,非常感谢!
离线bhwbj
只看该作者 4楼 发表于: 2009-06-15
QSqlRelationalDelegate error,可能是跟数据库有关。是在configure的时候一起编译的demos还是都编译好后才编的?
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线bhwbj
只看该作者 5楼 发表于: 2009-06-15
我记得我好像是-nomake-demos。如果我需要跑跑demos,再单独编哪个例子。

在Makefile里加入-I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtSql
-lQtSql

看看有用没。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 6楼 发表于: 2009-06-15
在编译Qt-embedded 时
我所用的参数是:

${BUILD_PATH}/${QTE_VERSION}/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


编完后,然后进入demos目录编译
按你的方式加了,还是不行

在Makefile 里加入

INCPATH += -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtSql

这一步编译能够通过,不过接下来又有问题了

好像找不到  QtOpenGL 这个库?
错误如下:


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. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtSql -o glbuffers.o boxes/glbuffers.cpp
In file included from boxes/glbuffers.h:46,
                 from boxes/glbuffers.cpp:42:
boxes/glextensions.h:45:20: error: QtOpenGL: No such file or directory
In file included from boxes/glbuffers.h:46,
                 from boxes/glbuffers.cpp:42:
boxes/glextensions.h:124: error: 'ptrdiff_t' does not name a type
boxes/glextensions.h:155: error: typedef '_glCreateShaderObjectARB' is initialized (use __typeof__ instead)
boxes/glextensions.h:155: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:156: error: 'GLuint' has not been declared
boxes/glextensions.h:156: error: 'GLint' has not been declared
boxes/glextensions.h:158: error: 'GLenum' has not been declared
boxes/glextensions.h:160: error: 'GLsizei' has not been declared
boxes/glextensions.h:160: error: 'GLsizei' has not been declared
boxes/glextensions.h:166: error: ISO C++ forbids declaration of 'GLint' with no type
boxes/glextensions.h:166: error: typedef 'GLint' is initialized (use __typeof__ instead)
boxes/glextensions.h:166: error: '_glGetUniformLocationARB' was not declared in this scope
boxes/glextensions.h:167: error: typedef '_glUniform1iARB' is initialized (use __typeof__ instead)
boxes/glextensions.h:167: error: 'GLint' was not declared in this scope
boxes/glextensions.h:167: error: 'GLint' was not declared in this scope
boxes/glextensions.h:168: error: typedef '_glUniform1fARB' is initialized (use __typeof__ instead)
boxes/glextensions.h:168: error: 'GLint' was not declared in this scope
boxes/glextensions.h:168: error: 'GLfloat' was not declared in this scope
boxes/glextensions.h:169: error: typedef '_glUniform4fARB' is initialized (use __typeof__ instead)
boxes/glextensions.h:169: error: 'GLint' was not declared in this scope
boxes/glextensions.h:169: error: 'GLfloat' was not declared in this scope
boxes/glextensions.h:169: error: 'GLfloat' was not declared in this scope
boxes/glextensions.h:169: error: 'GLfloat' was not declared in this scope
boxes/glextensions.h:169: error: 'GLfloat' was not declared in this scope
boxes/glextensions.h:170: error: typedef '_glUniformMatrix4fvARB' is initialized (use __typeof__ instead)
boxes/glextensions.h:170: error: 'GLint' was not declared in this scope
boxes/glextensions.h:170: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:170: error: 'GLboolean' was not declared in this scope
boxes/glextensions.h:170: error: expected primary-expression before 'const'
boxes/glextensions.h:172: error: typedef '_glGenFramebuffersEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:172: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:172: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:172: error: expected primary-expression before ')' token
boxes/glextensions.h:173: error: typedef '_glGenRenderbuffersEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:173: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:173: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:173: error: expected primary-expression before ')' token
boxes/glextensions.h:174: error: typedef '_glBindRenderbufferEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:174: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:174: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:175: error: typedef '_glRenderbufferStorageEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:175: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:175: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:175: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:175: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:176: error: typedef '_glDeleteFramebuffersEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:176: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:176: error: expected primary-expression before 'const'
boxes/glextensions.h:177: error: typedef '_glDeleteRenderbuffersEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:177: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:177: error: expected primary-expression before 'const'
boxes/glextensions.h:178: error: typedef '_glBindFramebufferEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:178: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:178: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:179: error: typedef '_glFramebufferTexture2DEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:179: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:179: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:179: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:179: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:179: error: 'GLint' was not declared in this scope
boxes/glextensions.h:180: error: typedef '_glFramebufferRenderbufferEXT' is initialized (use __typeof__ instead)
boxes/glextensions.h:180: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:180: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:180: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:180: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:181: error: ISO C++ forbids declaration of 'GLenum' with no type
boxes/glextensions.h:181: error: typedef 'GLenum' is initialized (use __typeof__ instead)
boxes/glextensions.h:181: error: '_glCheckFramebufferStatusEXT' was not declared in this scope
boxes/glextensions.h:183: error: typedef '_glActiveTexture' is initialized (use __typeof__ instead)
boxes/glextensions.h:183: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:184: error: typedef '_glTexImage3D' is initialized (use __typeof__ instead)
boxes/glextensions.h:184: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:184: error: 'GLint' was not declared in this scope
boxes/glextensions.h:184: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:184: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:184: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:184: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:184: error: 'GLint' was not declared in this scope
boxes/glextensions.h:184: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:184: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:184: error: expected primary-expression before 'const'
boxes/glextensions.h:186: error: typedef '_glGenBuffers' is initialized (use __typeof__ instead)
boxes/glextensions.h:186: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:186: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:186: error: expected primary-expression before ')' token
boxes/glextensions.h:187: error: typedef '_glBindBuffer' is initialized (use __typeof__ instead)
boxes/glextensions.h:187: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:187: error: 'GLuint' was not declared in this scope
boxes/glextensions.h:188: error: typedef '_glBufferData' is initialized (use __typeof__ instead)
boxes/glextensions.h:188: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:188: error: 'GLsizeiptr' was not declared in this scope
boxes/glextensions.h:188: error: expected primary-expression before 'const'
boxes/glextensions.h:188: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:189: error: typedef '_glDeleteBuffers' is initialized (use __typeof__ instead)
boxes/glextensions.h:189: error: 'GLsizei' was not declared in this scope
boxes/glextensions.h:189: error: expected primary-expression before 'const'
boxes/glextensions.h:190: error: typedef '_glMapBuffer' is initialized (use __typeof__ instead)
boxes/glextensions.h:190: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:190: error: 'GLenum' was not declared in this scope
boxes/glextensions.h:191: error: ISO C++ forbids declaration of 'GLboolean' with no type
boxes/glextensions.h:191: error: typedef 'GLboolean' is initialized (use __typeof__ instead)
boxes/glextensions.h:191: error: '_glUnmapBuffer' was not declared in this scope
boxes/glextensions.h:195: error: expected ',' or '...' before '*' token
boxes/glextensions.h:195: error: ISO C++ forbids declaration of




谢谢
离线edgepoly
只看该作者 7楼 发表于: 2009-06-15
本人用的是 QtEmbedded-4.5.1-arm.tar.gz
离线bhwbj
只看该作者 8楼 发表于: 2009-06-15
你不能把所有的demo一块编啊,你编译qt的时候可是去了很多选项的。

我是configure的时候不要demos,安装好后设置qmake环境变量,然后进入安装目录下的examples:

#cd /tmp/qt-embedded-linux-opensource-src-4.5.1/examples/dialogs/findfiles

这个例子比较简单,需要的条件不多,直接qmake -project ;qmake; make 就行了。

编译demos和example要小心环境变量qmake,安装的时候是qt3的qmake,装好后要换成qte的qmake。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线violet520
只看该作者 9楼 发表于: 2009-06-15
安装的时候是qt3的qmake,装好后要换成qte的qmake????
安装的时候怎么看用的是qt3的qmake??
离线bhwbj
只看该作者 10楼 发表于: 2009-06-15
qmake -v
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 11楼 发表于: 2009-06-16
编译Qt-embedded 怎么这么难啊

郁闷啊

按楼主的方法,编个基本的程序也不行啊
不是这个错,就是那个错,




引用第8楼bhwbj于2009-06-15 14:08发表的  :
你不能把所有的demo一块编啊,你编译qt的时候可是去了很多选项的。
我是configure的时候不要demos,安装好后设置qmake环境变量,然后进入安装目录下的examples:
#cd /tmp/qt-embedded-linux-opensource-src-4.5.1/examples/dialogs/findfiles
.......
离线bhwbj
只看该作者 12楼 发表于: 2009-06-16
你可以多google些安装帖子,综合起来看
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线bhwbj
只看该作者 13楼 发表于: 2009-06-16
再说了,应该先确定需求,会需要什么库,就编译哪个选项,所谓的裁减么。你想简单干脆直接 ./configure。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 14楼 发表于: 2009-06-16
原先用

qmake -project
qmake

产生Makefile 文件

能正常检测出arm-linux-gcc

现在却检测不出来了
采用了gcc选项,只能采用手动改,不知道为什么

而且 examples 目录下基本是编译不过的
离线edgepoly
只看该作者 15楼 发表于: 2009-06-16
在编译  examples/desktop 例子时:
出现如下错误,楼主能帮我看一下吗?
谢了:

第一次搞qt 真得很不容易啊,感觉


Makefile:220: warning: overriding commands for target `main.o'
Makefile:214: warning: ignoring old commands for target `main.o'
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o main.o systray/main.cpp
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o screenshot.o screenshot/screenshot.cpp
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o window.o systray/window.cpp
/usr/local/Trolltech/QtEmbedded-4.5.1-arm/bin/moc -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. screenshot/screenshot.h -o moc_screenshot.cpp
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o moc_screenshot.o moc_screenshot.cpp
/usr/local/Trolltech/QtEmbedded-4.5.1-arm/bin/moc -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. systray/window.h -o moc_window.cpp
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o moc_window.o moc_window.cpp
/usr/local/Trolltech/QtEmbedded-4.5.1-arm/bin/rcc -name systray systray/systray.qrc -o qrc_systray.cpp
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iscreenshot -Isystray -I. -I. -o qrc_systray.o qrc_systray.cpp
arm-linux-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib -o desktop main.o screenshot.o main.o window.o moc_screenshot.o moc_window.o qrc_systray.o    -L/usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.5.1-arm/lib -lQtNetwork -lQtCore -lm -lrt -ldl -lpthread
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [desktop] Error 1
离线bhwbj
只看该作者 16楼 发表于: 2009-06-16
我把desktop下的screenshot目录拷贝到/usr/local/Trolltech/QtEmbedded-4.5.1-arm下,qmake -project; qmake ;make编译通过。
建议不要一编一大片,需要哪个例子就编哪个。

注:我也是编译desktop出现同样的错误,所以我就进去编一个例子了。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 17楼 发表于: 2009-06-16
这个可以 编译通过,不过把编译好的binary文件下载到
板子(MW2440)上还是跑不起来的。

错误提示如下:

bash-4.0# /data/screenshot
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
No Qtopia Core server appears to be running.
If you want to run this program as a server,
add the "-qws" command-line option.
bash-4.0#




引用第16楼bhwbj于2009-06-16 18:59发表的  :
我把desktop下的screenshot目录拷贝到/usr/local/Trolltech/QtEmbedded-4.5.1-arm下,qmake -project; qmake ;make编译通过。
建议不要一编一大片,需要哪个例子就编哪个。
注:我也是编译desktop出现同样的错误,所以我就进去编一个例子了。
离线bhwbj
只看该作者 18楼 发表于: 2009-06-17
唔,拜托,运行的时候要加 -qws 你还是没仔细看过我的帖子啊。。。。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 19楼 发表于: 2009-06-17
引用第18楼bhwbj于2009-06-17 10:12发表的  :
唔,拜托,运行的时候要加 -qws 你还是没仔细看过我的帖子啊。。。。



呵呵,不好意思啊。

我现在在我平台装了两个qt-embedded, 一个是 for x86的,用qvfb模拟framebuffer, 另外一个是for arm版的

我写了一个基本的helloWorld.cpp

#include <qapplication.h>
#include <qlabel.h>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QLabel *label=new QLabel("Hello Qt");

    label->setGeometry(10,10,200,80);

    label->show();
    return app.exec();

}

在主机端和 arm开发板上都能正常运行,区别是arm开发板能支持usb鼠标,不过目前还不支持光标,操作起来有点困难。
在开发板上会显示一个对话框窗口,绿色背景的。




然后我用同样的方法编译   examples/desktop/screenshot/  例子,会在该目录下生成screenshot 可执行文件(一个是elf for x86, 一个是 elf for arm)

在主机端(x86版)运行
./screenshot -qws
能够正常运行



但是在arm开发板上运行却
报如下错误,是不是没有考什么库啊?
bash-4.0# ./screenshot -qws
./screenshot: symbol lookup error: ./screenshot: undefined symbol: _ZN7QWidget9dropEventEP10QDropEvent
bash-4.0# udevd-event[2419]: rmdir(//dev) failed: Device or resource busy

udevd-event[2417]: rmdir(//dev) failed: Device or resource busy


bash-4.0#


请楼主在再帮我分析一下是什么问题,谢了。
离线bhwbj
只看该作者 20楼 发表于: 2009-06-17
我的板子上空间不够了,所以用nfs挂载了pc上的/usr/local/Trolltech/QtEmbedded-4.5.1-arm 到/mnt/hd

export PATH=/mnt/hd:/bin:/usr/bin:/usr/local/bin:$PATH

export LD_LIBRARY_PATH=/mnt/hd/lib:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH

export set QWS_MOUSE_PROTO=LinuxTP:/dev/h3600_tsraw
export QT_PLUGIN_PATH=/mnt/hd/plugins
export QT_QWS_FONTDIR=/mnt/hd/lib/fonts
export QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0"


在板子上运行/mnt/hd/demos/screenshot/screenshot -qws

没有错误,正常运行了。

我在板子上运行Qtembedded for x86编译的screenshot,错误是:
line 1: syntax error: "(" unexpected


你的错误还是头一次见到,关rmdir什么事呢??一个删除目录的命令 - -!

不过  “./screenshot: symbol lookup error” 我感觉和环境变量的有关。我先吃饭啊,一会再看看。
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 21楼 发表于: 2009-06-17
我用的是nfs boot方式,

我把/usr/local/Trolltech/QtEmbedded-4.5.1-arm/ 的所有文件拷到 rootfs 目录下,
然后修改 rcS文件如下:


#export set QTDIR=/opt/qt
export set QTDIR=/QtEmbedded-4.5.1-arm
export PATH=$QTDIR:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/lib:/usr/local/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$QTDIR/plugins
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
export set QWS_MOUSE_PROTO=LinuxTP:/dev/h3600_tsraw
export QWS_DISPLAY=LinuxFb:/dev/fb0
export QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0"
export QWS_SIZE=480x272


结果还是不行,还是只有我那个helloWorld程序可以跑。

bash-4.0# ./screenshot -qws
./screenshot: symbol lookup error: ./screenshot: undefined symbol: _ZN7QWidget9dropEventEP10QDropEvent
bash-4.0# udevd-event[2301]: rmdir(//dev) failed: Device or resource busy

udevd-event[2303]: rmdir(//dev) failed: Device or resource busy



Btw,  楼主在开发板上有没有移植成功Qtopia啊?

我的最终目标是移植Qtopia, 不过现在连这一步还没有迈过去。

神啊,救救我吧。
离线edgepoly
只看该作者 22楼 发表于: 2009-06-17
楼主你用的gcc 版本是多少?
离线bhwbj
只看该作者 23楼 发表于: 2009-06-18
晤,arm-linux-gcc 3.4.1,扬创2440开发板。

Qtopia和QtEmbedded不一样啊,Qtopia是完整的桌面环境。你要是用Qtopia直接下个装了,不用装QtEmbedded。


我的QtEmbedded-4.5.1-arm/ 下所有东西加起来有131M呢,你全拷到板子上了??


用screenshot的绝对路径运行看看呢?就是/usr/local/Trolltech/QtEmbedded-4.5.1-arm/demos/screeshot/screenshot -qws这样。
[ 此帖被bhwbj在2009-06-18 09:57重新编辑 ]
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线bhwbj
只看该作者 24楼 发表于: 2009-06-18
I'm Back!!
当加班已成为习惯
msn:bhwshx@hotmail.com

欢迎交流,人妖除外!!
离线edgepoly
只看该作者 25楼 发表于: 2009-06-18
引用第23楼bhwbj于2009-06-18 09:33发表的  :
晤,arm-linux-gcc 3.4.1,扬创2440开发板。
Qtopia和QtEmbedded不一样啊,Qtopia是完整的桌面环境。你要是用Qtopia直接下个装了,不用装QtEmbedded。
.......



我用的是 gcc4.4.0 估计跟这个有关,好像网上能成功的都是用gcc3.4.1啊,这个版本太老了。


我一开始就是下Qtopia直接编译的啊,不过就是跑不起来啊:
http://www.qtcn.org/bbs/read.php?tid=19280
快速回复
限100 字节
 
上一个 下一个