• 6562阅读
  • 3回复

用Qt2编译一个小程序出现错误,在线等解答 [复制链接]

上一主题 下一主题
离线uh2398373
 
只看楼主 倒序阅读 楼主  发表于: 2008-03-27
— 本帖被 XChinux 执行加亮操作(2008-03-29) —
用Qt2编译一个小程序出现错误如下,请哪位高手帮忙解答下,谢谢
ot@liuying test1]# ls
hello.cpp  hello.h  hello.o  hello.pro  hello.ui  main.cpp  makefile
[root@liuying test1]# 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_hello.o(.text+0x104): first defined here
moc_hello.o(.bss+0x0): multiple definition of `Form1::metaObj'
moc_hello.o(.bss+0x0): first defined here
moc_hello.o(.text+0xc): In function `Form1::tr(char const*)':
: multiple definition of `Form1::tr(char const*)'
moc_hello.o(.text+0xc): first defined here
moc_hello.o(.text+0x4c): In function `Form1::tr(char const*, char const*)':
: multiple definition of `Form1::tr(char const*, char const*)'
moc_hello.o(.text+0x4c): first defined here
moc_hello.o(.text+0x88): In function `Form1::staticMetaObject()':
: multiple definition of `Form1::staticMetaObject()'
moc_hello.o(.text+0x88): first defined here
collect2: ld returned 1 exit status
make: *** [hello] Error 1
离线uh2398373
只看该作者 1楼 发表于: 2008-03-28
问题已经解决
离线XChinux

只看该作者 2楼 发表于: 2008-03-29
是何缘由?
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线dragonfever
只看该作者 3楼 发表于: 2011-04-18
回 1楼(uh2398373) 的帖子
楼主是怎么解决的??
遇到同样错误 。。。
快速回复
限100 字节
 
上一个 下一个