首页| 论坛| 消息

标题:用Qt2编译一个小程序出现错误,在线等解答
作者:uh2398373
日期:2008-03-27 19:40
内容:

用Qt2编译一个小程序出现错误如下,请哪位高手帮忙解答下,谢谢
ot@liuying test1]# ls
hello.cpp hello.h hello.o hello.pro hello.ui main.cpp makefile
# make
makefile:119: warning: overriding commands for target `moc_hello.cpp'
makefile:116: warning: ignoring old commands for target `moc_hello.cpp'
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/root/omap5910qt/qt-2.3.10/include -o main.o main.cpp
/root/omap5910qt/qt-2.3.10/bin/moc hello.h -o moc_hello.cpp
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/root/omap5910qt/qt-2.3.10/include -o moc_hello.o moc_hello.cpp
arm-linux-g++ -o hello hello.o main.o hello.o moc_hello.o moc_hello.o -L/root/omap5910qt/qt-2.3.10/lib -lm -lqte
hello.o(.text+0x0): In function `Form1::Form1(QWidget*, char const*, bool, unsigned int)':
: multiple definition of `Form1::Form1(QWidget*, char const*, bool, unsigned int)'
hello.o(.text+0x0): first defined here
hello.o(.text+0x294): In function `Form1::Form1(QWidget*, char const*, bool, unsigned int)':
: multiple definition of `Form1::Form1(QWidget*, char const*, bool, unsigned int)'
hello.o(.text+0x294): first defined here
hello.o(.text+0x528): In function `Form1::~Form1()':
: multiple definition of `Form1::~Form1()'
hello.o(.text+0x528): first defined here
hello.o(.text+0x548): In function `Form1::~Form1()':
: multiple definition of `Form1::~Form1()'
hello.o(.text+0x548): first defined here
hello.o(.text+0x568): In function `Form1::~Form1()':
: multiple definition of `Form1::~Form1()'
hello.o(.text+0x568): first defined here
moc_hello.o(.text+0x0): In function `Form1::className() const':
: multiple definition of `Form1::className() const'
moc_hello.o(.text+0x0): first defined here
moc_hello.o(.text+0x104): In function `Form1::initMetaObject()':
: multiple definition of `Form1::initMetaObject()'
moc_hel ..


#1 [uh2398373 03-28 10:56]
问题已经解决
#2 [XChinux 03-29 18:36]
是何缘由?
#3 回 1楼(uh2398373) 的帖子 [dragonfever 04-18 10:07]
楼主是怎么解决的??
遇到同样错误 。。。

回复 发表
主题 版块