重新链接使用带有隐式链接的更新共享库的应用程序? [英] relinking applications that use updated shared library with implicit linking?
问题描述
假设我更改了一个共享库并重新编译了它.
我是否必须重新链接所有使用该共享库的主要应用程序(如果我使用带有隐式链接的共享库 - #include "myLib.h"
)或者当这些应用程序自动完成重新链接负载?
Let's say I changed a shared library and recompiled it.
Do I have to relink all main applications that use that shared lib (in case I'm using that shared library with implicit linking - #include "myLib.h"
) or relinking is done automatically when those applications load?
推荐答案
只有当 Application库的二进制接口 (ABI) 与以前的版本不兼容 - 如果删除了某些公共函数或更改了它们的签名,如果更改了某些结构的大小,更改了虚函数顺序以及其他一些情况,则可能会发生这种情况.
You have to recompile only if the Application Binary Interface (ABI) of the library is incompatible with previous version - it could happen if some public functions are removed or their signature is changed, if some structures' sizes are changed, virtual functions order is changed and some other cases.
否则你不需要重新链接 - 这是使用 共享库,允许在不分发新版本应用程序的情况下分发它们的新版本.
Otherwise you don't need re-linking - that is one of the main advantages of using shared libraries, allowing to distribute new versions of them without distributing new versions of the applications.
这篇关于重新链接使用带有隐式链接的更新共享库的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!