I understand the concept of Static and Dynamic linking. It is known that on Windows platform, .dll
are the dynamic libraries and .lib
are the stati
The "usual" windows tool chains offer two "flavours" of .lib.
One is the static libraries you mention. When used, there is no associated .dll.
The other is a stripped library that is only there to hook in the code to load and fix functions pointers for the dynamic library at load time.
With dynamic libraries (the .dll) you can either load it your self (via. LoadLibrary
) or you can use the stub (import) .lib you have been provided with the .dll. Favour the import .lib if one is provided.
Why did I had to copy the .dll files when I already linked the static libraries (.lib) ?
The .dll needs to be in the path, or the directory with the .exe for the loader to find it.
How do I differentiate whether the .lib file is Static library or Dynamic library?
Generally the documentation should include some level of detail about this. If they are lumped in the same folder, then I would assume the .lib is tied to the .dll. If all else fails, look at the file size; if the .lib is tied to the .dll, then it is normally small in comparison to the .dll.