P-3.5 Compiling, Linking and Build Tools
You can explain the stages between source files and an executable, tell a compile error from a link error, and describe what a build tool is deciding when it rebuilds.
Every language hides a build system, and C's is thin enough to see through. Preprocessing, compiling, assembling and linking are four separate steps producing four separate kinds of error, and being able to name which one failed cuts most build problems in half. The distinction that saves the most time is between a compile error, which is about one file, and a link error, which is about how the files fit together.
Work through these
The four stages: preprocess, compile, assemble, link
Each stage takes the previous stage's output and each can fail on its own terms. Running them separately once makes the whole process concrete rather than magical.
Header files and the preprocessor, which only pastes text
Including a header copies its text into your file before compiling begins, which is why a missing declaration and a missing definition are entirely different complaints.
Undefined reference: a link error, not a compile error
The compiler was satisfied that a function exists somewhere and the linker could not find it. Reading the message as a spelling problem rather than a missing library wastes a lot of time.
NPTEL: Introduction to Programming in C · CourseStatic and dynamic libraries, and what ships with your program
Library code can be copied into your executable or loaded when it starts, and the choice decides both the size of the file and whether it runs on a machine that lacks the library.
A build tool rebuilds what changed, using file times
A build file records which outputs depend on which inputs so that only the affected parts are rebuilt. Most confusing build behaviour comes from a dependency nobody declared.
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 31 Aug 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.