通过隐式链接重新链接使用更新的共享库的应用程序?

发布于 2024-10-06 20:39:18 字数 126 浏览 0 评论 0原文

假设我更改了共享库并重新编译了它。
我是否必须重新链接使用该共享库的所有主要应用程序(如果我使用带有隐式链接的共享库 - #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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宣告ˉ结束 2024-10-13 20:39:18

仅当库的应用程序二进制接口 (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.

南街女流氓 2024-10-13 20:39:18

您不必重新链接。程序启动时会自动链接共享库。不要将其视为“重新”链接,它们一开始就没有物理链接。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文