• 5319阅读
  • 2回复

qt编译出错,大侠来帮帮忙啊 [复制链接]

上一主题 下一主题
离线hyy_777
 
只看楼主 正序阅读 楼主  发表于: 2008-12-26
— 本帖被 XChinux 执行加亮操作(2009-01-06) —
配置 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[not-in-charge](QWidget*,
char const*, unsigned)':
: multiple definition of `Spectrum::Spectrum[not-in-charge](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[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `Spectrum::Spectrum[in-charge](QWidget*, char const*, unsigned)'
Spectrum.o(.text+0x2a4): first defined here
Spectrum.o(.text+0x548): In function `Spectrum::~Spectrum [not-in-charge]()':
: multiple definition of `Spectrum::~Spectrum [not-in-charge]()'
Spectrum.o(.text+0x548): first defined here
Spectrum.o(.text+0x568): In function `Spectrum::~Spectrum [in-charge]()':
: multiple definition of `Spectrum::~Spectrum [in-charge]()'
Spectrum.o(.text+0x568): first defined here
Spectrum.o(.text+0x588): In function `Spectrum::~Spectrum [in-charge deleting]()':
: multiple definition of `Spectrum::~Spectrum [in-charge deleting]()'
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(.text+0xc): In function `Spectrum::initMetaObject()':
: multiple definition of `Spectrum::initMetaObject()'
moc_Spectrum.o(.text+0xc): first defined here
moc_Spectrum.o(.text+0xf0): In function `Spectrum::staticMetaObject()':
: multiple definition of `Spectrum::staticMetaObject()'
moc_Spectrum.o(.text+0xf0): first defined here
moc_Spectrum.o(.text+0x70): In function `Spectrum::tr(char const*)':
: multiple definition of `Spectrum::tr(char const*)'
moc_Spectrum.o(.text+0x70): first defined here
moc_Spectrum.o(.text+0xb0): In function `Spectrum::tr(char const*, char const*)':
: multiple definition of `Spectrum::tr(char const*, char const*)'
moc_Spectrum.o(.text+0xb0): first defined here
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: skipping incompatible /gui/qt-2.3.7/lib/libqte.so when searching for -lqte
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: cannot find -lqte
collect2: ld returned 1 exit status
make: *** [Spectrum] Error 1

不知道错误在哪 怎么解决, 请大家帮帮忙 谢谢! 
离线wuchuan
只看该作者 2楼 发表于: 2009-03-19
Spectrum.o(.text+0x0): first defined here

应该是你的编译器没有找到需要依赖的库,导致了编译不能生成库
解决办法:一定要清楚你的程序的依赖关系

一般QT编译和运行不通过主要是因为各种各样的原因(比如:环境变量设置不对,编译选项不对,链接库选项不对等等)导致没有链接到所依赖的库
离线emofazelgp
只看该作者 1楼 发表于: 2009-03-18
你的库还是3.3.2的啊
快速回复
限100 字节
 
上一个 下一个