When you build an executable in C++, when including header files
For example,
#include <iostream>
Does the Preprocessor find the library iostream library and the function used or is the object code for the library functions injected at Linking?
When you build an executable in C++, when including header files
For example,
#include <iostream>
Does the Preprocessor find the library iostream library and the function used or is the object code for the library functions injected at Linking?
All #include
does is load in the definitions of the library functions and doesn't have anything to do with the binary instance of library itself.
Think of the header files as blueprints on how the library works, but does not provide the actual components that the program needs. It's just so the compiler can understand how the library works.
In order for that to come into play you must also link in the associated library files. This is done with different arguments at the linking stage.