天嵌 ARM开发社区

 找回密码
 注册
查看: 2796|回复: 10

Qt编译不成功(X86)

[复制链接]
113018467 发表于 2009-12-4 15:35:44 | 显示全部楼层 |阅读模式
本帖最后由 113018467 于 2009-12-4 15:39 编辑

我照Qt手册的去做,在"make”的时候出错,终端显示如下:
(附件里是我自己建的文件,请大家帮忙分析一下原因!!!谢谢!!)
[root@EmbedSky first]# make
Makefile:132: warning: overriding commands for target `moc_first.cpp'
Makefile:129: warning: ignoring old commands for target `moc_first.cpp'
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86_qtopia/qt/include -I/opt/EmbedSky/Qte/x86_qtopia/qtopia/include -o
first.o first.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86_qtopia/qt/include -I/opt/EmbedSky/Qte/x86_qtopia/qtopia/include -o
main.o main.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86_qtopia/qt/include -I/opt/EmbedSky/Qte/x86_qtopia/qtopia/include -o
moc_first.o moc_first.cpp
g++  -o /opt/EmbedSky/Qte/x86_qtopia/qtopia/bin/first first.o main.o first.o moc_first.o moc_first.o  -L/opt/EmbedSky/Qte/x86_qtopia/qtopia/lib -L/opt/EmbedSky/Qte/x86_qtopia/qt/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+0x344): In function `first::first[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `first::first[in-charge](QWidget*, char const*, unsigned)'
first.o(.text+0x344): first defined here
first.o(.text+0x688): In function `first::~first [not-in-charge]()':
: multiple definition of `first::~first [not-in-charge]()'
first.o(.text+0x688): first defined here
first.o(.text+0x6ac): In function `first::~first [in-charge]()':
: multiple definition of `first::~first [in-charge]()'
first.o(.text+0x6ac): first defined here
first.o(.text+0x6d0): In function `first::~first [in-charge deleting]()':
: multiple definition of `first::~first [in-charge deleting]()'
first.o(.text+0x6d0): first defined here
first.o(.text+0x6fc): In function `first::event(QEvent*)':
: multiple definition of `first::event(QEvent*)'
first.o(.text+0x6fc): first defined here
first.o(.text+0x778): In function `first::user_button()':
: multiple definition of `first::user_button()'
first.o(.text+0x778): 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/qtopia/bin/first] Error 1
[root@EmbedSky first]#

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 113018467 发表于 2009-12-4 15:49:32 | 显示全部楼层
另外,为什么我按手册里的去做,但我生成的Makefile会和手册里的不同,在后面那里会重复出现
moc_first.o: moc_first.cpp \
                first.h

moc_first.o: moc_first.cpp \
                first.h

moc_first.cpp: first.h
        $(MOC) first.h -o moc_first.cpp

moc_first.cpp: first.h
        $(MOC) first.h -o moc_first.cpp
具体情况在附件中的Makefile
 楼主| 113018467 发表于 2009-12-5 09:08:55 | 显示全部楼层
我发现在x86体系上编译通了以后,在仿真的时候,我点击我自己的程序,图标是动了,但是没有反应或出现程序设计的效果。在终端上显示"first: error while loading shared libraries: libqpe.so.1: cannot open shared object file: No such file or diectory”
它提示的"shared libraries”是什么呢?我已经在"ld.so.conf"里面设了手册上的两个变量了,而且都在路径上证明了变量时存在的,但是仿真的时候还是不行!!!!
亚瑟王 发表于 2009-12-5 11:34:29 | 显示全部楼层
设置一下环境变量。
 楼主| 113018467 发表于 2009-12-5 12:39:32 | 显示全部楼层
本帖最后由 113018467 于 2009-12-5 12:47 编辑

我已经在"ld.so.conf"里面设了手册上说的的那两个变量了!!!
你说的是不是要用指令"ldconfig"一下??
wq061714135 发表于 2009-12-6 00:47:59 | 显示全部楼层
我也是这样的问题 怎么搞的啊
sunhy1021 发表于 2009-12-7 09:47:09 | 显示全部楼层
我也出现这样的问题:
在终端上显示"first: error while loading shared libraries: libqpe.so.1: cannot open shared object file: No such file or diectory”
然后要怎么样去拷贝这样的库呢?
已经设置了环境变量!
pflysky 发表于 2009-12-8 09:35:57 | 显示全部楼层
对,我也出现了这种情况,我怀疑是tmake 出了问题
sunhy1021 发表于 2009-12-8 10:23:50 | 显示全部楼层
希望版主能尽快回答我们

“first: error while loading shared libraries: libqpe.so.1: cannot open shared object file: No such file or diectory”
wq061714135 发表于 2009-12-8 17:26:50 | 显示全部楼层
把MAkefile好好看下 把冗余信息删除掉就好了
sunhy1021 发表于 2009-12-8 17:33:47 | 显示全部楼层
我解决这个问题了
方法如下:

修改hello.pro文件,修改为:
TEMPLATE                 =app
CONFIG                    =qtopia warn_on release     
HEADERS                  =hello.h
SOURCES                  =hello.cpp \
                                    main.cpp
INTERFACES             =                       
一定要将“INTERFACES  = hello.ui”修改为“INTERFACES  =   ”否则会出现错误:报错,重定义。

可以看博客:http://hi.csdn.net/link.php?url=http://blog.csdn.net%2Fsunhy1021
X86—qtopia第一个应用程序(hello)编写
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-5-3 04:00 , Processed in 1.078132 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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