我在本机上编译Qt/E3.1.2的qvfb,uic,moc,qmake,designer等工具都是正常的(此时用的是linux-x86-g++),程序也能在qvfb中运行。因此我想编译能在ARM上使用的库文件,我根据前面用的Qt/E2.3.10和tmake的经验,先设置安装qmake所需要的环境变量:
[root@localhost qt-embedded-free-3.1.2]# export QMAKESPEC=qws/linux-arm-g++ (帮助文档里这么说的)
然后是设置编译Qt/E3.1.2的一些环境变量和配置选项:
[root@localhost qt-embedded-free-3.1.2]# export QTDIR=$QTEDIR
[root@localhost qt-embedded-free-3.1.2]# export PATH=$QTEDIR/bin:$PATH
[root@localhost qt-embedded-free-3.1.2]# export LD_LIBRARY_PATH=$QTEDIR/lib:$LD_LIBRARY_PATH
[root@localhost qt-embedded-free-3.1.2]# ./configure -xplatform qws/linux-arm-g++ -no-qvfb -depths 4,8,16,32
以下是终端的信息:
This is the Qt/Embedded Free Edition.
You are licensed to use this software under the terms of
the GNU General Public License (GPL).
Type 'G' to view the GNU General Public License.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.
Do you accept the terms of the license? yes
Creating qmake. Please wait...
/usr/bin/gmake -f Makefile qmake
gmake[1]: Entering directory `/home/qt-embedded-free-3.1.2/qmake'
arm-linux-g++ -c -o project.o -DQWS -I. -Igenerators -Igenerators/unix -Igenerators/win32
-Igenerators/mac -I/home/qt-embedded-free-3.1.2/include/qmake
-I/home/qt-embedded-free-3.1.2/include -I/home/qt-embedded-free-3.1.2/include
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS
-I/home/qt-embedded-free-3.1.2/mkspecs/qws/linux-arm-g++ project.cpp
In file included from /home/qt-embedded-free-3.1.2/include/qtextstream.h:43,
from /home/qt-embedded-free-3.1.2/include/qtl.h:43,
from /home/qt-embedded-free-3.1.2/include/qvaluelist.h:42,
from /home/qt-embedded-free-3.1.2/include/qstringlist.h:42,
from project.h:40,
from project.cpp:38:
/home/qt-embedded-free-3.1.2/include/qstring.h: In member function `ushort&
QChar::unicode()':
/home/qt-embedded-free-3.1.2/include/qstring.h:185: error: cannot bind packed field
`((QChar*)this)->QChar::ucs' to `ushort&'
gmake[1]: *** [project.o] Error 1
gmake[1]: Leaving directory `/home/qt-embedded-free-3.1.2/qmake'
gmake: *** [uqmake] Error 2
qmake failed to build. Aborting.
我看了一下$QTEDIR/qmake下的Makefile,然后与在本机上编译(用linux-x86-g++)是生成qmake的Makefile对比了一下,只有下面这一项不一样:
CFLAGS= -DQWS \
-I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \
-I/home/qt-embedded-free-3.1.2/include/qmake -I/home/qt-embedded-free-3.1.2/include -I/home/qt-embedded-free-3.1.2/include \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \
-DQT_NO_COMPRESS -I/home/qt-embedded-free-3.1.2/mkspecs/qws/linux-arm-g++
也就是编译器(下划线处)不一样,请问站长和其他前辈们,我的设置是不是有错误或者是其他原因,希望大家多多指点,不胜感激!![p:4]