Compiling/Linking
Can someone please give me a basic rundown of how the compiling and linking stages work. Take for example the basic begining code snippet.
#include <stdio.h>
void main()
{
printf("Hello World");
}
Ok, the # causes the preprocessor program to run. But what exactly does the preprocessor do??? The include tells the compiler to "include" stdio.h in the the program. Does this mean that the code in stdio.h will be added to my source file or does it just provide a reference to the stdio.h file so it can find the instructions for how to handle printf()???? After compilation and i have the .obj the linker adds code modules from the program libraries. Are the program Libraries header files??? I am just trying to get a more thorough understaning of how the how compiling/linking process works??
Does the compiling stage just take the .c/.cpp file and turn everything in the file into machine code and the linking process is what combines the .obj file with the .h file??
Any help is greatly appreciated,
Thanks
|