首页| 论坛| 消息

标题:qt编译出错,大侠来帮帮忙啊
作者:hyy_777
日期:2008-12-26 15:25
内容:

配置 tmake 1.11 cross 2.95.3 qt-x11-2.3.1 qt-embedded-2.3.7
编译成的时候出现如下:
arm-linux-g++ -o Spectrum Spectrum.o main.o Spectrum.o moc_Spectrum.o moc_Spectrum.o -L/usr/local/arm/2.95.3/lib -L/gui/qt-2.3.7/lib -lm -lqte
Spectrum.o(.text+0x0): In function `Spectrum::Spectrum(QWidget*,
char const*, unsigned)':
: multiple definition of `Spectrum::Spectrum(QWidget*, char const*, unsigned)'
Spectrum.o(.text+0x0): first defined here
Spectrum.o(.text+0x5b4): In function `Spectrum::languageChange()':
: multiple definition of `Spectrum::languageChange()'
Spectrum.o(.text+0x5b4): first defined here
Spectrum.o(.text+0x2a4): In function `Spectrum::Spectrum(QWidget*, char const*, unsigned)':
: multiple definition of `Spectrum::Spectrum(QWidget*, char const*, unsigned)'
Spectrum.o(.text+0x2a4): first defined here
Spectrum.o(.text+0x548): In function `Spectrum::~Spectrum ()':
: multiple definition of `Spectrum::~Spectrum ()'
Spectrum.o(.text+0x548): first defined here
Spectrum.o(.text+0x568): In function `Spectrum::~Spectrum ()':
: multiple definition of `Spectrum::~Spectrum ()'
Spectrum.o(.text+0x568): first defined here
Spectrum.o(.text+0x588): In function `Spectrum::~Spectrum ()':
: multiple definition of `Spectrum::~Spectrum ()'
Spectrum.o(.text+0x588): first defined here
Spectrum.o(.text+0x6d4): In function `Spectrum::Draw()':
: multiple definition of `Spectrum::Draw()'
Spectrum.o(.text+0x6d4): first defined here
moc_Spectrum.o(.text+0x0): In function `Spectrum::className() const':
: multiple definition of `Spectrum::className() const'
moc_Spectrum.o(.text+0x0): first defined here
moc_Spectrum.o(.bss+0x0): multiple definition of `Spectrum::metaObj'
moc_Spectrum.o(.bss+0x0): first defined here
moc_Spectrum.o(. ..


#1 [emofazelgp 03-18 21:48]
你的库还是3.3.2的啊
#2 [wuchuan 03-19 10:20]
Spectrum.o(.text+0x0): first defined here
应该是你的编译器没有找到需要依赖的库,导致了编译不能生成库
解决办法:一定要清楚你的程序的依赖关系
一般QT编译和运行不通过主要是因为各种各样的原因(比如:环境变量设置不对,编译选项不对,链接库选项不对等等)导致没有链接到所依赖的库

回复 发表
主题 版块