Compilation Process
C++
Jan 26, 2023
Compilation includes 4 steps
1. Preprocess
2. Compile
3. Assemble
4. Link
Preprocess
clang++ -E main.cpp>main.i
Preprocess includes codes for files, removes comments, header and expand macros.
Compilation
clang++ -S main.i
Generates main.s file.
Assembly
clang++ -c main.s
Generates main.o file.
Linking
clang++ main.o -o main
Generates main as executable file.
That’s it for now. See you later.