Code is written in a series of source files and then passed to a compiler which produces a binary (a library or an executable program).
Header files do not get compiled, only .cpp files, but header files get included into cpp files and that's when they get compiled.
Every cpp file will get compiled individually into an .obj file.
To stitch all the .obj files together into one .exe file, and that's the Linker's job.
In C++ there is no such thing as a file.
First the compiler preprocesses the code and evaluates all the preprocessor statements.
Tokenizing C++ code resulting in abstract syntax tree.
Generate actual machine code.
A .cpp file doesn't necessarily equal a translation unit because a .cpp file can include other .cpp files and make one translation unit out of them.
After compiling our source files we need to go through the linking process.
The linker will find where symbols are and link them together.