In reference to this answer:
There are two Linux C/C++ library types.
Static libraries (
*.a
) are archives of object code which are linked with and becomes part of the application. They are created with and can be manipulated using thear(1)
command (i.e.ar -t libfoo.a
will list the files in the library/archive).Dynamically linked shared object libraries (
*.so
) can be used in two ways.
- The shared object libraries can be dynamically linked at run time but statically aware. The libraries must be available during compile/link phase. The shared objects are not included into the binary executable but are tied to the execution.
- The shared object libraries can be dynamically loaded/unloaded and linked during execution using the dynamic linking loader system functions.
what does it mean to make a dynamic lib tied to the execution?
Is this like Windows manifest files that allow the application to load in a specific dll?
What's the mechanism to control the .so loaded?
There must be such a mechanism otherwise the "compiled" .so is the only one ever allowed to be loaded which defeats the purpose of making it dynamic?