Reputation: 78498
I noticed the following about a library I use:
I open the .sln (solution) file of the library (it is open source) and see the following in its Project properties:
My confusion is:
Note that I am aware of the difference between static libraries and dynamic libraries in the Linux world.
Upvotes: 0
Views: 425
Reputation: 17258
A Windows DLL can be dynamically loaded with the LoadLibrary (or LoadLibraryEx) API, but then you have to find and bind each exported function to a function pointer using GetProcAddress or GetProcAddressEx. You'd better get the function signatures right, or Bad Things Will Happen, as usual.
A LIB file allows Windows to do all that for you when your EXE is started (including finding which DLL to use, and recursively loading dependent DLL's), linking the dynamic library statically at run time, while avoiding bloating your EXE file with the executable code, and allowing several processes to share the same DLL image in memory.
Upvotes: 2
Reputation: 179779
The "RunTime Library" option isn't about YOUR library. It tells the compiler that you'll import your functions from MSVCRTxx.DLL
at runtime.
The "configuration Type" option does refer to your library, and therefore is independent of the "RunTime Library" option.
Upvotes: 3
Reputation:
I don't know about the config mismatch, but a .LIB file when created with a .DLL library is an "export library" - it doesn't contain any code, but just the names of the callable functions and objects in the DLL. The linker uses this to satisfy references at link time which are finally resolved by dynamic loading at run-time.
Upvotes: 1