LZ我按照你的步骤一步一步弄并且重复了一个晚上,最终在最后一步出错,解决不掉。下面是出错的信息。
[root@localhost test]# ./build
Makefile:171: warning: overriding commands for target `.obj/release-shared/test.o'
Makefile:163: warning: ignoring old commands for target `.obj/release-shared/test.o'
Makefile:192: warning: overriding commands for target `.moc/release-shared/moc_test.cpp'
Makefile:189: warning: ignoring old commands for target `.moc/release-shared/moc_test.cpp'
rm -f .obj/release-shared/moc_test.o .obj/release-shared/moc_testform.o
rm -f .moc/release-shared/moc_test.cpp .moc/release-shared/moc_testform.cpp
rm -f .ui/release-shared/testform.cpp .ui/release-shared/testform.h
rm -f .obj/release-shared/test.o .obj/release-shared/main.o .obj/release-shared/test.o .obj/release-shared/testform.o
rm -f *~ core *.core
Makefile:171: warning: overriding commands for target `.obj/release-shared/test.o'
Makefile:163: warning: ignoring old commands for target `.obj/release-shared/test.o'
Makefile:192: warning: overriding commands for target `.moc/release-shared/moc_test.cpp'
Makefile:189: warning: ignoring old commands for target `.moc/release-shared/moc_test.cpp'
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic testform.ui -o .ui/release-shared/testform.h
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"test\" -DQTOPIA_TRTARGET=\"test\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ -I. -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I.moc/release-shared/ -o .obj/release-shared/test.o test.cpp
../qtopia-2.2.0-FriendlyARM/qt2/include/qtooltip.h:87: warning: ‘class QToolTip’ has virtual functions but non-virtual destructor
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"test\" -DQTOPIA_TRTARGET=\"test\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ -I. -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I.moc/release-shared/ -o .obj/release-shared/main.o main.cpp
../qtopia-2.2.0-FriendlyARM/qt2/include/qdatetime.h:51: warning: ‘class QDate’ has virtual functions but non-virtual destructor
../qtopia-2.2.0-FriendlyARM/qtopia/include/qtopia/../../src/libraries/qtopia/qcom.h:88: warning: ‘struct QUnknownInterface’ has virtual functions but non-virtual destructor
../qtopia-2.2.0-FriendlyARM/qtopia/include/qtopia/../../src/libraries/qtopia/qcom.h:100: warning: ‘struct QLibraryInterface’ has virtual functions but non-virtual destructor
../qtopia-2.2.0-FriendlyARM/qtopia/include/qtopia/../../src/libraries/qtopia/applicationinterface.h:49: warning: ‘struct ApplicationInterface’ has virtual functions but non-virtual destructor
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic testform.ui -i testform.h -o .ui/release-shared/testform.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"test\" -DQTOPIA_TRTARGET=\"test\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ -I. -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I.moc/release-shared/ -o .obj/release-shared/testform.o .ui/release-shared/testform.cpp
../qtopia-2.2.0-FriendlyARM/qt2/include/qtooltip.h:87: warning: ‘class QToolTip’ has virtual functions but non-virtual destructor
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/moc test.h -o .moc/release-shared/moc_test.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"test\" -DQTOPIA_TRTARGET=\"test\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ -I. -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I.moc/release-shared/ -o .obj/release-shared/moc_test.o .moc/release-shared/moc_test.cpp
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/moc .ui/release-shared/testform.h -o .moc/release-shared/moc_testform.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"test\" -DQTOPIA_TRTARGET=\"test\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ -I. -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I.moc/release-shared/ -o .obj/release-shared/moc_testform.o .moc/release-shared/moc_testform.cpp
g++ -o test .obj/release-shared/test.o .obj/release-shared/main.o .obj/release-shared/test.o .obj/release-shared/testform.o .obj/release-shared/moc_test.o .obj/release-shared/moc_testform.o -lqtopia2 -lqtopia -lqpe -L/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/lib -L/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/lib -lqte
.obj/release-shared/test.o: In function `TestForm::~TestForm()':
test.cpp:(.text+0x0): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x0): first defined here
.obj/release-shared/test.o: In function `TestForm::~TestForm()':
test.cpp:(.text+0x2c): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x2c): first defined here
.obj/release-shared/test.o: In function `TestForm::~TestForm()':
test.cpp:(.text+0x46): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x46): first defined here
.obj/release-shared/test.o: In function `TestForm::TestForm(QWidget*, char const*, unsigned int)':
test.cpp:(.text+0x60): multiple definition of `TestForm::TestForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/test.o:test.cpp:(.text+0x60): first defined here
.obj/release-shared/test.o: In function `TestForm::TestForm(QWidget*, char const*, unsigned int)':
test.cpp:(.text+0x1ca): multiple definition of `TestForm::TestForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/test.o:test.cpp:(.text+0x1ca): first defined here
.obj/release-shared/testform.o: In function `TestForm::~TestForm()':
testform.cpp:(.text+0x0): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x0): first defined here
.obj/release-shared/testform.o: In function `TestForm::~TestForm()':
testform.cpp:(.text+0x2c): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x2c): first defined here
.obj/release-shared/testform.o: In function `TestForm::~TestForm()':
testform.cpp:(.text+0x46): multiple definition of `TestForm::~TestForm()'
.obj/release-shared/test.o:test.cpp:(.text+0x46): first defined here
.obj/release-shared/testform.o: In function `TestForm::TestForm(QWidget*, char const*, unsigned int)':
testform.cpp:(.text+0x60): multiple definition of `TestForm::TestForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/test.o:test.cpp:(.text+0x60): first defined here
.obj/release-shared/testform.o: In function `TestForm::TestForm(QWidget*, char const*, unsigned int)':
testform.cpp:(.text+0x1ca): multiple definition of `TestForm::TestForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/test.o:test.cpp:(.text+0x1ca): first defined here
.obj/release-shared/moc_testform.o: In function `TestForm::className() const':
moc_testform.cpp:(.text+0x0): multiple definition of `TestForm::className() const'
.obj/release-shared/moc_test.o:moc_test.cpp:(.text+0x0): first defined here
.obj/release-shared/moc_testform.o: In function `TestForm::staticMetaObject()':
moc_testform.cpp:(.text+0x52): multiple definition of `TestForm::staticMetaObject()'
.obj/release-shared/moc_test.o:moc_test.cpp:(.text+0x52): first defined here
.obj/release-shared/moc_testform.o:(.bss+0x0): multiple definition of `TestForm::metaObj'
.obj/release-shared/moc_test.o:(.bss+0x0): first defined here
.obj/release-shared/moc_testform.o: In function `TestForm::tr(char const*, char const*)':
moc_testform.cpp:(.text+0x9c): multiple definition of `TestForm::tr(char const*, char const*)'
.obj/release-shared/moc_test.o:moc_test.cpp:(.text+0x9c): first defined here
.obj/release-shared/moc_testform.o: In function `TestForm::tr(char const*)':
moc_testform.cpp:(.text+0xc6): multiple definition of `TestForm::tr(char const*)'
.obj/release-shared/moc_test.o:moc_test.cpp:(.text+0xc6): first defined here
.obj/release-shared/moc_testform.o: In function `TestForm::initMetaObject()':
moc_testform.cpp:(.text+0xf0): multiple definition of `TestForm::initMetaObject()'
.obj/release-shared/moc_test.o:moc_test.cpp:(.text+0xf0): first defined here
collect2: ld returned 1 exit status
make: *** [test] Error 1