When we want to use Win32 API, we’d specify the import libraries that have the API functions we want to use. For example, if I want to use the HttpCreateServerSession function to create a server session, I need to specify httpapi.lib in the linker input setting.
Why there’s no httpapi_d.lib (the debug version)? Why we can use Win32 release version import libraries in our debug version project without any compile/link warning/error?
Normally, when we implement a DLL, we will create both debug and release versions of the import library for people who want to use our DLL. Why Microsoft can provide only the release version? Thanks.
Import libraries contain only function stubs, and as such, don’t need to have any debug symbols (you’d have a different library if you were linking to a different, debug DLL — but you normally don’t, even though you build your program as Debug variant). If you want debug symbols for a system DLL, use the MS symbol server (see e.g. WinDbg documentation on how).
Also, it’s not a linker error to link “debug DLL” with a “release program”, because “debug” and “release” concepts don’t exist at this level (you might get errors related to different ABI, but that’s not quite the same).