If the preprocessor takes the header files in the #include statements, such as #include , and puts them into the source code, why does the linker have to link it? Isn't the code for that header file already inside the source, ergo the object code, and machine code?

  • 1
    Possible duplicate of What does the linker do?! – kzidane Jan 1 '15 at 14:13
  • When we include the header file of a library in our code, it pastes the prototypes of all the functions implemented in that library, but note that it just pastes the prototypes of the functions, their implementation code is not included/pasted, this part is done by the linker thing. I am not sure though, let others give their input. – segmentationfaulter Jan 1 '15 at 18:58

Browse other questions tagged .