Definition:

  • A dynamic link library is an executable file that contains code and data that are loaded into memory by the operating system when needed.
  • Dynamic libraries are not copied directly into the main program’s executable file, but rather linked to it at runtime.
    • Small piece of code, stub, used to locate the appropriate memory-resident library routine
  • Characteristics:
    • Linked to the program at runtime
    • Loaded into memory by the OS only when required
    • Shared among multiple programs that use the same library
    • Dependencies can be resolved at runtime
  • Example: A libmath.dll dynamic library contains math functions that can be loaded into memory and used by multiple C++ programs at runtime.