relinking applications that use updated shared library with implicit linking?
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?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.
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.
精彩评论