relinking applications that use updated shared library with implicit linking?

不羁的心 提交于 2019-12-10 23:33:52

问题


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?


回答1:


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.




回答2:


You should not have to relink. Shared libraries are linked automatically when the program starts. Do not think of it as "re"-linking, they are not physically linked in the first place.



来源:https://stackoverflow.com/questions/4417989/relinking-applications-that-use-updated-shared-library-with-implicit-linking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!