Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Video Overview

  • What is static vs dynamic linking?

  • Static

    • Build a library whose code gets copied into the final executable when linking.
    • File formats
      • MacOS - .a
      • Linux - .a
      • Windows - .lib
  • Dynamic

    • Build a library that stays as a separate file, and the executable loads it at runtime.
    • File formats
      • MacOS - .dylib
      • Linux - .so (shared object)
      • Windows - .dll
  • Static libMathLib.a | +----> App A (copy add()) +----> App B (copy add()) +----> App C (copy add())

  • Dynamic App A ----
    App B -----+----> libMathLib.dylib App C ----/

Commands

cmake -S . -B build && cmake --build build
# lldb commands
image list
image lookup --name add

Titles

  • What Does the C++ Linker Actually Do?
  • What's the Difference Between Static and Dynamic Linking in C++?
  • How Does C++ Link Static and Dynamic Libraries?
  • What does the C++ compiler do when you link your code?

References