Static Vs Dynamic Libraries
Library is a collection of precompiled functions and data that your program can reuse. Libraries Improve the modularity, reduce the code…
Static Vs Dynamic Libraries
Library is a collection of precompiled functions and data that your program can reuse. Libraries Improve the modularity, reduce the code duplication and speed up development
- Static Libraries -> Linked at compile time
- Dynamic Libraries -> Linked at run time

Static vs Dynamic libraries
Static library has its own text & data sections and maintains separate memory map for each process
Process A: — — — — — — — — — — — — — — — — - | App Code + Lib Code (TEXT) | | App Data + Lib Data | — — — — — — — — — — — — — — — — -
Process B: — — — — — — — — — — — — — — — — - | App Code + Lib Code (TEXT) | | App Data + Lib Data | — — — — — — — — — — — — — — — — -
Dynamic library will use shared text sections mapped once into physical memory and shared across all the processes and maintain its own copy of data sections
RAM: — — — — — — — — — — — — — — — — - | Shared Library TEXT (1 copy) | — — — — — — — — — — — — — — — — -
Process A: | App TEXT | | Private Lib DATA |
Process B: | App TEXT | | Private Lib DATA |
In Windows to build as DLL
#define FUNC_DECL __declspec(dllexport) WINAPI — It tells the compiler to export this function from DLL so other applications can use it
메타데이터
- post_id
- 686f3fe4a707
- slug
- static-vs-dynamic-libraries-686f3fe4a707
- url
- https://medium.com/@naveennani_81244/static-vs-dynamic-libraries-686f3fe4a707
- canonical_url
- https://medium.com/@naveennani_81244/static-vs-dynamic-libraries-686f3fe4a707
- author_url
- https://medium.com/@naveennani_81244
- status
- ok
- fetched_at
- 2026-06-24 11:06:28