Shared library are stored as .so
(or in Windows .dll
, or in OS X .dylib
) files.
These are linked dynamically simply including the address of the library (whereas static linking is a waste of space). Dynamic linking links the libraries at the run-time. Thus, all the functions are in a special place in memory space, and every program can access them, without having multiple copies of them.
See: Static Library
Source: https://www.geeksforgeeks.org/difference-between-static-and-shared-libraries/