ABI
这里与我们常用的API的概念一起拿出来对比认识。
API全称:Application Program Interface
An API defines the interfaces by which one piece of software communicates with another at the source level.
ABI全称:Application Binary Interface
Whereas an API defines a source interface, an ABI defines the low-level binary interface between two or more pieces of software on a particular architecture. It defines how an application interacts with itself, how an application interacts with the kernel, and how an application interacts with libraries.
可以参考这个链接difference-between-api-and-abi
兼容性问题
由于在gcc5.1版本中,libstdc++库中使用了新版本的底层string和list,为了与原有方式兼容,引入了新版本的ABI。即是gcc5.1之后,默认含有string类型的函数,其函数签名不一样。
例如:void Get(std::string str);
旧版本ABI的函数签名为:
_Z3GetSs
使用c+