天嵌 ARM开发社区

 找回密码
 注册
查看: 3110|回复: 5

QT编译错误!请问各位大哥帮忙解决一下

[复制链接]
li1033313370 发表于 2012-3-19 15:01:15 | 显示全部楼层 |阅读模式
[root@localhost first]# make
Makefile:125: warning: overriding commands for target `moc_first.cpp'
Makefile:122: warning: ignoring old commands for target `moc_first.cpp'
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/uic first.ui -o ./first.h
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/uic first.ui -i first.h -o first.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o first.o first.cpp
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/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 -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o main.o main.cpp
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include/qdatetime.h:51: warning: ‘class QDate’ has virtual functions but non-virtual destructor
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include/qtopia/../../src/libraries/qtopia/qcom.h:88: warning: ‘struct QUnknownInterface’ has virtual functions but non-virtual destructor
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include/qtopia/../../src/libraries/qtopia/qcom.h:100: warning: ‘struct QLibraryInterface’ has virtual functions but non-virtual destructor
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include/qtopia/../../src/libraries/qtopia/applicationinterface.h:49: warning: ‘struct ApplicationInterface’ has virtual functions but non-virtual destructor
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/moc first.h -o moc_first.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o moc_first.o moc_first.cpp
g++  -o /opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first first.o main.o first.o moc_first.o moc_first.o  -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/lib -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/lib -lqpe -lqtopia -lqte
first.o: In function `first::user_button()':
first.cpp:(.text+0x0): multiple definition of `first::user_button()'
first.o:first.cpp:(.text+0x0): first defined here
first.o: In function `first::~first()':
first.cpp:(.text+0x10): multiple definition of `first::~first()'
first.o:first.cpp:(.text+0x10): first defined here
first.o: In function `first::~first()':
first.cpp:(.text+0x40): multiple definition of `first::~first()'
first.o:first.cpp:(.text+0x40): first defined here
first.o: In function `first::~first()':
first.cpp:(.text+0x60): multiple definition of `first::~first()'
first.o:first.cpp:(.text+0x60): first defined here
first.o: In function `first::event(QEvent*)':
first.cpp:(.text+0x80): multiple definition of `first::event(QEvent*)'
first.o:first.cpp:(.text+0x80): first defined here
first.o: In function `first::first(QWidget*, char const*, unsigned int)':
first.cpp:(.text+0x170): multiple definition of `first::first(QWidget*, char const*, unsigned int)'
first.o:first.cpp:(.text+0x170): first defined here
first.o: In function `first::first(QWidget*, char const*, unsigned int)':
first.cpp:(.text+0x550): multiple definition of `first::first(QWidget*, char const*, unsigned int)'
first.o:first.cpp:(.text+0x550): first defined here
moc_first.o: In function `first::className() const':
moc_first.cpp:(.text+0x0): multiple definition of `first::className() const'
moc_first.o:moc_first.cpp:(.text+0x0): first defined here
moc_first.o: In function `first::staticMetaObject()':
moc_first.cpp:(.text+0x90): multiple definition of `first::staticMetaObject()'
moc_first.o:moc_first.cpp:(.text+0x90): first defined here
moc_first.o:(.bss+0x0): multiple definition of `first::metaObj'
moc_first.o:(.bss+0x0): first defined here
moc_first.o: In function `first::tr(char const*, char const*)':
moc_first.cpp:(.text+0x170): multiple definition of `first::tr(char const*, char const*)'
moc_first.o:moc_first.cpp:(.text+0x170): first defined here
moc_first.o: In function `first::tr(char const*)':
moc_first.cpp:(.text+0x1b0): multiple definition of `first::tr(char const*)'
moc_first.o:moc_first.cpp:(.text+0x1b0): first defined here
moc_first.o: In function `first::initMetaObject()':
moc_first.cpp:(.text+0x1f0): multiple definition of `first::initMetaObject()'
moc_first.o:moc_first.cpp:(.text+0x1f0): first defined here
collect2: ld returned 1 exit status
make: *** [/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first] Error 1

TQ-lkp 发表于 2012-3-20 09:49:37 | 显示全部楼层
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o main.o main.cpp

你明显没有用交叉编绎器
 楼主| li1033313370 发表于 2012-3-20 22:49:40 | 显示全部楼层
TQ-lkp 发表于 2012-3-20 09:49
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia- ...

谢谢大哥,哈哈我已经解决了!
wangyunshan 发表于 2012-3-21 17:26:59 | 显示全部楼层
li1033313370 发表于 2012-3-20 22:49
谢谢大哥,哈哈我已经解决了!

不懂。怎么解决的呀,我的也是这个问题
 楼主| li1033313370 发表于 2012-3-22 07:34:58 | 显示全部楼层
wangyunshan 发表于 2012-3-21 17:26
不懂。怎么解决的呀,我的也是这个问题

在重新配置一下交叉工具链,然后记得在开始编译的时候导入环境变量,设置环境,然后就是注意Makefile文件就OK了!
wangyunshan 发表于 2012-3-26 10:11:38 | 显示全部楼层
li1033313370 发表于 2012-3-22 07:34
在重新配置一下交叉工具链,然后记得在开始编译的时候导入环境变量,设置环境,然后就是注意Makefile文件 ...

恢复完了谢谢哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-12 14:00 , Processed in 1.062500 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表