Search code examples
clinkage

C Linkage Terminology Differences


There is static linkage, dynamic linkage. What is type where it imports compiled functions from a library and compiles it into the binary?


Solution

  • In static linking, the compiled functions are stored into the executable or dynamic library (if you're creating one).

    In dynamic linking, the compiled function is stored in a separated library (DLL in Windows or shared object in Linux). A small piece if code is added to the executable to load that shared library at runtime and map the public functions and variables within it.