我弄这个mini2440的Qtopia应用编程弄了好几天了,连第一个程序都编译不过,真的好郁闷!!照着http://www.aiothome.net/read.php?tid-5599-keyword-%D4%B4%C2%EB.html这个帖子做都编译不过!我把错误信息贴出来,大家帮忙看看哈 [root@localhost myhello]# ./build
Makefile:187: 警告:覆盖关于目标“.moc/release-shared/moc_myhello.cpp”的命令
Makefile:184: 警告:忽略关于目标“.moc/release-shared/moc_myhello.cpp”的旧命令
rm -f .obj/release-shared/moc_myhello.o .obj/release-shared/moc_testHello.o
rm -f .moc/release-shared/moc_myhello.cpp .moc/release-shared/moc_testHello.cpp
rm -f .ui/release-shared/testHello.cpp .ui/release-shared/testHello.h
rm -f .obj/release-shared/myhello.o .obj/release-shared/main.o .obj/release-shared/testHello.o
rm -f *~ core *.core
Makefile:187: 警告:覆盖关于目标“.moc/release-shared/moc_myhello.cpp”的命令
Makefile:184: 警告:忽略关于目标“.moc/release-shared/moc_myhello.cpp”的旧命令
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic testHello.ui -o .ui/release-shared/testHello.h
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"myhello\" -DQTOPIA_TRTARGET=\"myhello\" -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/myhello.o myhello.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"myhello\" -DQTOPIA_TRTARGET=\"myhello\" -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
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic testHello.ui -i testHello.h -o .ui/release-shared/testHello.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"myhello\" -DQTOPIA_TRTARGET=\"myhello\" -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/testHello.o .ui/release-shared/testHello.cpp
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/moc myhello.h -o .moc/release-shared/moc_myhello.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"myhello\" -DQTOPIA_TRTARGET=\"myhello\" -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_myhello.o .moc/release-shared/moc_myhello.cpp
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/moc .ui/release-shared/testHello.h -o .moc/release-shared/moc_testHello.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"myhello\" -DQTOPIA_TRTARGET=\"myhello\" -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_testHello.o .moc/release-shared/moc_testHello.cpp
g++ -o myhello .obj/release-shared/myhello.o .obj/release-shared/main.o .obj/release-shared/testHello.o .obj/release-shared/moc_myhello.o .obj/release-shared/moc_testHello.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/testHello.o: In function `non-virtual thunk to MyHelloForm::~MyHelloForm()':
testHello.cpp:(.text+0x0): multiple definition of `non-virtual thunk to MyHelloForm::~MyHelloForm()'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x0): first defined here
.obj/release-shared/testHello.o: In function `MyHelloForm::~MyHelloForm()':
testHello.cpp:(.text+0x8): multiple definition of `MyHelloForm::~MyHelloForm()'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x8): first defined here
.obj/release-shared/testHello.o: In function `non-virtual thunk to MyHelloForm::~MyHelloForm()':
testHello.cpp:(.text+0x34): multiple definition of `non-virtual thunk to MyHelloForm::~MyHelloForm()'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x34): first defined here
.obj/release-shared/testHello.o: In function `MyHelloForm::~MyHelloForm()':
testHello.cpp:(.text+0x3c): multiple definition of `MyHelloForm::~MyHelloForm()'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x3c): first defined here
.obj/release-shared/testHello.o: In function `MyHelloForm::~MyHelloForm()':
testHello.cpp:(.text+0x56): multiple definition of `MyHelloForm::~MyHelloForm()'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x56): first defined here
.obj/release-shared/testHello.o: In function `MyHelloForm::MyHelloForm(QWidget*, char const*, unsigned int)':
testHello.cpp:(.text+0x70): multiple definition of `MyHelloForm::MyHelloForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x70): first defined here
.obj/release-shared/testHello.o: In function `MyHelloForm::MyHelloForm(QWidget*, char const*, unsigned int)':
testHello.cpp:(.text+0x172): multiple definition of `MyHelloForm::MyHelloForm(QWidget*, char const*, unsigned int)'
.obj/release-shared/myhello.o:myhello.cpp:(.text+0x172): first defined here
.obj/release-shared/moc_testHello.o: In function `MyHelloForm::className() const':
moc_testHello.cpp:(.text+0x0): multiple definition of `MyHelloForm::className() const'
.obj/release-shared/moc_myhello.o:moc_myhello.cpp:(.text+0x0): first defined here
.obj/release-shared/moc_testHello.o: In function `MyHelloForm::staticMetaObject()':
moc_testHello.cpp:(.text+0x52): multiple definition of `MyHelloForm::staticMetaObject()'
.obj/release-shared/moc_myhello.o:moc_myhello.cpp:(.text+0x52): first defined here
.obj/release-shared/moc_testHello.o:(.bss+0x0): multiple definition of `MyHelloForm::metaObj'
.obj/release-shared/moc_myhello.o:(.bss+0x0): first defined here
.obj/release-shared/moc_testHello.o: In function `MyHelloForm::tr(char const*, char const*)':
moc_testHello.cpp:(.text+0x9c): multiple definition of `MyHelloForm::tr(char const*, char const*)'
.obj/release-shared/moc_myhello.o:moc_myhello.cpp:(.text+0x9c): first defined here
.obj/release-shared/moc_testHello.o: In function `MyHelloForm::tr(char const*)':
moc_testHello.cpp:(.text+0xc6): multiple definition of `MyHelloForm::tr(char const*)'
.obj/release-shared/moc_myhello.o:moc_myhello.cpp:(.text+0xc6): first defined here
.obj/release-shared/moc_testHello.o: In function `MyHelloForm::initMetaObject()':
moc_testHello.cpp:(.text+0xf0): multiple definition of `MyHelloForm::initMetaObject()'
.obj/release-shared/moc_myhello.o:moc_myhello.cpp:(.text+0xf0): first defined here
collect2: ld returned 1 exit status
make: *** [myhello] 错误 1
下面是myhello.pro文件######################################################################
# Automatically generated by qmake (1.07a) Tue Aug 3 22:34:42 2010
######################################################################
CONFIG += qtopiaapp
CONFIG -= buildQuicklaunch
HEADERS = myhello.h
SOURCES = myhello.cpp
TEMPLATE = app
INCLUDEPATH += .
# Input
HEADERS += myhello.h
INTERFACES += testHello.ui
SOURCES += main.cpp
TARGET = myhello
下面是main.cpp文件#include "myhello.h"
#include <qtopia/qpeapplication.h>
QTOPIA_ADD_APPLICATION("myhello",MyHelloForm)
QTOPIA_MAIN
下面是myhello.h文件#ifndef MYHELLOFORM_H
#define MYHELLOFORM_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QPushButton;
class MyHelloForm : public QWidget
{
Q_OBJECT
public:
MyHelloForm( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~MyHelloForm();
QPushButton* PushButton;
};
#endif // MYHELLOFORM_H
下面是myhello.cpp文件#include "myhello.h"
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a MyHelloForm which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
MyHelloForm::MyHelloForm( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "MyHelloForm" );
resize( 259, 317 );
setCaption( tr( "Say Hi to ..Qtopia" ) );
PushButton = new QPushButton( this, "PushButton" );
PushButton->setGeometry( QRect( 70, 140, 111, 51 ) );
PushButton->setText( tr( "PushButtonOK" ) );
}