When compiling C source files, we include header files for example using #include "myheader.h"
.
The pre-processor will expand this header file before compiling the file. However, how does it find this header file exactly? I believe, the path of the header files is passed as an argument to the linker using -I
for example to gcc.
I always thought that the linker only runs after compilation. So does the linker actually run before, to find stuff such as header files, and after compilation to combine various object files etc. ? Thanks