⚙️Linker
Also known as Linking, Link Step
A tool that joins built pieces of code into one program.
Think of it like
Think of it like stapling loose pages into one book. Each page was written on its own first.
Example
Jack's app has main.c and math.c. Each compiles to its own .o file. The linker joins them, and the program prints 5.
Why it matters
Big programs are built from thousands of files. Linking is what lets each one be compiled on its own.
Definition
Example code
console
$ gcc -c math.c
$ gcc -c main.c
$ gcc main.o math.o -o app
$ ./app
5Common mistake
Key takeaways
- 1Pieces in. Object files and libraries.
- 2Calls connected. Each to its code.
- 3One program out. Ready to run.