The process has nothing to do with #include
, even less with the namespace
.
This has to do with linkage of the code. When going to use some DLL the executable is generated in a form that is indicated that the exact code will be picked from the DLL at the time of execution and some information is placed to make the call dynamic link. When calling the executable it will search the DLL and load what is necessary by making an adaptation of the provisional address that had been placed in the executable to the actual address of the code present in the DLL.
The only relationship with the #include
is that the compilation needs to know the signatures of functions which will be called in the DLL. This is only information for the compiler, the DLL code will not be placed next to your code. Even if you have an error in the header you will have problems while running. The .h
has to have information synchronized with the code that is in the DLL.
Okay. Okay. But, here’s the thing: how is this linkage process done? So the executable "reference" that DLL? What *.lib files have to do with it?
– Paulo
@Paul essentially doesn’t need to do anything in most cases. The DLL needs to be available and the header need to be all ok. If you have a more concrete question ask in a new question.
– Maniero
I get it. Thank you.
– Paulo