steps from source code to executable
- preprocess by preprocessor,
gcc -E(ouput to stdout, use
-oto file), combine
.c/.ccinto translation unit,
- compile by compiler,
gcc -S, compile files either into several assembler input files, or into one assembler input file,
- assembly by assembler,
gcc -c, each assembler input file produces an object file,
- linkage by linker,
ld, combines all object files(those newly compiled, and those specified as input) into an executable file
gcc -v to view the details
Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.
scope and linkage, is on translation unit, not on file.
- An object can be defined exactly once in a prgram.
- It may be declared many times, but the types must agree exactly.