天嵌 ARM开发社区

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

求助!hello QT

[复制链接]
caizhi07 发表于 2010-1-14 16:35:06 | 显示全部楼层 |阅读模式
按照QT程序开发完全手册写了个hello的程序,结果出这么一个错误,请高人指点一二:
编译器的输出信息如下
[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'
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(.text+0x0): In function `first::first[not-in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `first::first[not-in-charge](QWidget*, char const*, unsigned)'
first.o(.text+0x0): first defined here
first.o(.text+0x38c): In function `first::first[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `first::first[in-charge](QWidget*, char const*, unsigned)'
first.o(.text+0x38c): first defined here
first.o(.text+0x718): In function `first::~first [not-in-charge]()':
: multiple definition of `first::~first [not-in-charge]()'
first.o(.text+0x718): first defined here
first.o(.text+0x73c): In function `first::~first [in-charge]()':
: multiple definition of `first::~first [in-charge]()'
first.o(.text+0x73c): first defined here
first.o(.text+0x760): In function `first::~first [in-charge deleting]()':
: multiple definition of `first::~first [in-charge deleting]()'
first.o(.text+0x760): first defined here
first.o(.text+0x78c): In function `first::event(QEvent*)':
: multiple definition of `first::event(QEvent*)'
first.o(.text+0x78c): first defined here
first.o(.text+0x858): In function `first::user_button()':
: multiple definition of `first::user_button()'
first.o(.text+0x858): first defined here
moc_first.o(.text+0x0): In function `first::className() const':
: multiple definition of `first::className() const'
moc_first.o(.text+0x0): first defined here
moc_first.o(.data+0x0): multiple definition of `first::metaObj'
moc_first.o(.data+0x0): first defined here
moc_first.o(.text+0xc): In function `first::initMetaObject()':
: multiple definition of `first::initMetaObject()'
moc_first.o(.text+0xc): first defined here
moc_first.o(.text+0xcc): In function `first::staticMetaObject()':
: multiple definition of `first::staticMetaObject()'
moc_first.o(.text+0xcc): first defined here
moc_first.o(.text+0x74): In function `first::tr(char const*)':
: multiple definition of `first::tr(char const*)'
moc_first.o(.text+0x74): first defined here
moc_first.o(.text+0xa0): In function `first::tr(char const*, char const*)':
: multiple definition of `first::tr(char const*, char const*)'
moc_first.o(.text+0xa0): 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
[root@localhost first]#
jordanjgc 发表于 2010-1-15 15:12:31 | 显示全部楼层
一样的问题,运行qpe,也说没找到
sunhy1021 发表于 2010-1-16 23:19:43 | 显示全部楼层
重复定义了!
看我的博客 http://blog.csdn.net/sunhy1021/archive/2009/12/08/4965305.aspx
里面有写
sunhy1021 发表于 2010-1-16 23:20:30 | 显示全部楼层
编辑hello.pro文件,修改为:

TEMPLATE                 =app

CONFIG                    =qtopia warn_on release        (把qt改为qtopia,这样就可以调用qtopia的库)

HEADERS                  =hello.h

SOURCES                  =hello.cpp \

                                    main.cpp

INTERFACES             =                        

一定要将“INTERFACES  = hello.ui”修改为“INTERFACES  =   ”否则会出现错误:报错,重定义。



本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/sunhy1021/archive/2009/12/08/4965305.aspx
亚瑟王 发表于 2010-1-18 11:40:16 | 显示全部楼层
1、在我们手册里面讲了Makefile的修改的,你应该没有注意到这个问题;
2、qpe不能运行,如果qpe没有编译成功,需要重新编译qtopia,然后在设置环境变量后执行qpe,如果qpe已经编译成功了,在设置环境变量后执行qpe。
lbn321 发表于 2014-2-24 10:29:13 | 显示全部楼层
如何看qpe是否编译成功了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-30 10:22 , Processed in 1.062494 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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