Module 15 · The Preprocessor, Headers and Multi File Builds
Multi File Builds: Compiling, Linking and a First Makefile
ProReading
Kenji's game keeps its scores in three files: main.c, list.c and the header list.h. After every edit he types the same long gcc line, and GCC compiles every file again.
Pro lesson
This one goes deeper
It is included with this track and with Learn Pro. Every question on the Skill Test can be answered from the free lessons, so this is depth and never a gate on the certificate.
What is inside Multi File Builds: Compiling, Linking and a First Makefile
- Kenji's program in three files
- Two steps: compile each file, then link
- What an object file holds
- A file left out: undefined reference
- A first Makefile
- The timestamp experiment: what make rebuilds
- CMake writes the Makefile for you
- argc and argv: the words after the program's name