一.动态链接库的ABI
二.引起动态链接库不兼容的行为
- 删除一个导出类;
- 改变导出类的继承层次
- 改变模板的模板参数
- 删除一个导出函数
- 改变函数的inline属性
- 改变函数的签名
- 在一个非虚基类或者没有含有虚函数的类中添加一个虚函数
- 改变虚函数的声明次序
- ......
三.一般不会引起动态链接库不兼容的行为
- 增加一个非虚函数
- 删除没有被inline函数调用的非虚函数
- 改变一个函数的默认参数
- 增加新的static数据成员
- 导出一个新的参数
- 增加或者删除一个友元声明
- ......
四.详细的内容(英文)
Note about ABI
This text applies to most C++ ABIs used by compilers which KDE can be built with. It is mostly based on the Itanium C++ ABI Draft, which is used by the GCC C++ compiler since version 3.4 in all platforms it supports. Information about Microsoft Visual C++ mangling scheme mostly comes from this article on calling conventions (it's the most complete information found so far on MSVC ABI and name mangling).
Some of the constraints specified here may not apply to a given compiler. The goal here is to list the most restrictive set of conditions when writing cross-platform C++ code, meant to be compiled with several different compilers.
This page is updated when new binary incompatibility issues are found.