Liste des Groupes | Revenir à cl c |
On 08/06/2024 01:39, Kaz Kylheku wrote:dynamic linking is linking?On 2024-06-07, bart <bc@freeuk.com> wrote:You use a shared library.It's you who can't get your head around the idea that someone could be>
away with a 'linker'.
You can do away with linkers and linking.
>
But it's pretty helpful when
>
1. the same library is reused for many programs.
2. you're selling a library, and would like to ship a binary image ofYou ship a shared library.
that library.
Without linkage, you don't have a library ecosystem.Of course you do. Eg. a program depends on the vast WinAPI; but you don't have to ship copies of all its DLLs, neither do you have to statically link them.
There are some fixups involving even with using dynamic linking. That's
taken care of by the OS loader. But the code involved isn't extensive. Here is an 800-line C program:
https://github.com/sal55/langs/blob/master/runmx.c
that loads a private executable format of mine; it loads any dynamic libraries also in the same format (but it doesn't multiple instances with other processes); and it resolves any symbols from dependent DLLs. Then it runs the program.
(Here written using WinAPI calls.)
Les messages affichés proviennent d'usenet.