The what and why of libraries
Before we go into the details of libraries, it's essential to understand what they are and why they matter to us. It's also important to understand the difference between static and dynamic libraries:
This knowledge will enable you to make smarter choices when making your own libraries.
A dynamic library is dynamically linked to the binary that uses it. What this means is that the library code isn't included in the binary. The library resides outside of the binary. This has several advantages. First, the resulting binary will be smaller in size since the library code isn't included. Second, the library can be updated without needing to recompile the binary. The disadvantage is that we can't move or delete the dynamic library from the system. If we do, the binary won't work anymore.