Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91782
  • 博文数量: 121
  • 博客积分: 1422
  • 博客等级: 上尉
  • 技术积分: 1235
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-05 13:10
文章分类

全部博文(121)

文章存档

2012年(9)

2011年(2)

2010年(110)

分类:

2010-03-20 17:43:17

使用多个动态库时因为都包含了模板类的实现,会造成符号冲突的告警,用下面的-bh:5的方法可以把这些告警关掉。很管用,世界清静了:)

ld: 0711-224 WARNING: Duplicate symbol: .std::bad_exception::~bad_exception()
ld: 0711-224 WARNING: Duplicate symbol: std::bad_exception::~bad_exception()
ld: 0711-224 WARNING: Duplicate symbol: .std::bad_typeid::~bad_typeid()
ld: 0711-224 WARNING: Duplicate symbol: std::bad_typeid::~bad_typeid()
ld: 0711-224 WARNING: Duplicate symbol: .std::logic_error::~logic_error()
ld: 0711-224 WARNING: Duplicate symbol: std::logic_error::~logic_error()
ld: 0711-224 WARNING: Duplicate symbol: std::logic_error::what() const
ld: 0711-224 WARNING: Duplicate symbol: std::logic_error::_Doraise() const
ld: 0711-224 WARNING: Duplicate symbol: .std::ios_base::failure::~failure()
ld: 0711-224 WARNING: Duplicate symbol: std::ios_base::failure::~failure()
ld: 0711-224 WARNING: Duplicate symbol: std::exception::what() const
ld: 0711-224 WARNING: Duplicate symbol: std::bad_alloc::_Doraise() const

Those warnings are due to the standard C++ iostream implementation.  Some functions are defined in the header of iostream, and they get included in both a library and inside your application.  The linker complains about duplicate symbols being defined by default.  This is not a problem with ICU. 

You have two options to fix this problem. 

1) Add -bh:5 when you link your application to silence these warnings 
2) Ask the AIX or the Visual Age people to fix their iostream implementation to silence these warnings. 

Using -O and removing -bnoquiet may reduce the number warnings, but it won't remove them completely like one of the above options.
阅读(4344) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~