Chinaunix首页 | 论坛 | 博客
  • 博客访问: 30032
  • 博文数量: 5
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-26 19:05
文章分类
文章存档

2016年(3)

2015年(2)

我的朋友

分类:

2015-12-25 15:21:09

使用多个动态库时因为都包含了模板类的实现,会造成符号冲突的告警,用下面的-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.
阅读(3068) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~