I wanna know what is going inside the steps when compiling a C++ source code to native code. I know the steps are such that:
1- Preprocessor copies the contents of included header files into the source code file.
Q1: So how would the C++ source code file look after such step?
Q2: Is the preprocessor a program?.
2- The expanded source code file produced after the step 1 is compiled into the assembly language for the platform.
3- The assembly code generated by the compiler is assembled into object code (native code) for the platform.
Q1: Why do the new source code file compiled into the assembly language before compiled into natve machine code?
After generating such assembly language it is supposed that the assembler is the program responsible for translating the assembly language or assembly instructions into native machine code.
Q2: So is the role of the compiler stops after generating the assembly language?
Q3: If the Q2 answer is Yes so will the compiler pass the produced assembly code file to an assembler and force it to translate the assembly code generated?
4- The object code file generated by the assembler is linked together with the object code files for any library functions used to produce an executable file.
Here is the role of the linker
Q1: Where is that linker is located?
Q2: I do not know what it is mean by "linked together with the object code files for any library functions used to produce an executable file"? For example, I'm using a library for drawing etc. what is that mean in the context of the previous quoted statment.
Finally, what is the best suggested book to read, assuming that I wanna start to study C++ as a beginner, to reach professionalism in C++