在linux下编译qt程序时出错(换个程序也是同样错误),错误请见下面。用的是qt-2.3.2 for x11、qt-embedded2.3.7、tmake1.11。cross3.3.2交叉编译工具。是不是qt-2.3.7/bin/moc和qt-2.3.7/lib/libqte.so文件和设定的编译器不一致啊?是不是我编译qt-embedded2.3.7的方法不对啊?
我的编译设置是:
export QTDIR=/usr/local/src/qt-2.3.7
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/src/qt/lib:$LD_LIBRARY_PATH
export PATH= /usr/local/arm/2.95.3/bin:$QTDIR/bin: /usr/local/src/qt/bin:$PATH
export TMAKEPATH="/usr/local/src/tmake-1.11/lib/qws/linux-arm-g++"
编译qt-embedded2.3.7的命令如下:
cp $QPEDIR/src/qt/qconfig-qpe.h /usr/local/src/qt-2.3.7/src/tools/
ln -s ../tmake-1.11 tmake
./configure –platform linux-arm-g++ -no-qvfb –no-opengl –qconfig qpe –depths 4,8,16,32
make –C src
编译qt程序的命令如下:
先在QT下编辑产生一个.ui文件
Uic –o gprs.h gprs.ui
Uic –o gprs.cpp –impl gprs.h gprs.ui
建立一个main.cpp文件
Progen –n gprs –o gprs.pro
Tmake –o Makefile gprs.pro
make
出现的错误如下:
moc_gprs.o(.text+0x18):in functio 'form1::initmetaobject(void)':
:multiple definition of 'form1::initmetaobject(void)'
moc_gprs.o(.rodata+0x1bo):undefined reference to 'QWidget::setkeycompression(bool)'
moc_gprs.o(.rodata+0x1b4):undefined reference to 'QWidget::setMicroFocusHint(int,int,int,int,bool)'
moc_gprs.o(.rodata+0x1b8):undefined reference to 'QDialog::accept(void)'
等等一系列类似的错误。
collect2:ld returned 1 exit status
make:***[gprs]error 1
麻烦各位高手帮我看看,这是怎么回事,是不是哪里有错误,应该怎么做?非常感谢!!
[ 此贴被XChinux在2006-03-20 19:41重新编辑 ]