Hi,
I think I understand the concept of static(.lib) vs. dynamic(.dll) libraries, but I don't think I fully understand the various kinds of .lib libraries.
1) I'm using MSBUILD to build a .dll library, and when I compile my codes, it creates .obj, .lib, and .dll files. So I understand what .obj and .dll files are, but why is the .lib library created? Is this library an import library? if so, where is it used? and which information can it contain?
2) Also I believe that there are MSBUILD macros like DLLLIBOBJECTS that we use to add extra objects to an import library. What purpose would it serve to add additional object files?
3) I built a mylib.lib file using C++ codes. This code uses Windows Crypto APIs. I also have another .dll project that links against this .lib file. Attempting to compile the .dll project without linking Crypt32.lib against it (using TARGETLIBS macro) resulted in unresolved symbol error (symbols representing the APIs that I used in the .lib source files). Because I didn't want to put burden on every project that uses mylib.lib of having to link against the crypt32.lib, I wanted to link crypt32.lib to mylib.lib, so that all such projects could simply link against one library mylib.lib, instead of two. But the same unresolved symbol error resulted when I tried to use this new mylib.lib. (the new mylib.lib was compiled after adding TARGETLIBS=$(LIBRARY_PATH)\Crypt32.lib in "sources" file of mylib.lib project). So is it the case that a .lib can't be linked within another .lib file?
4) At the bottom of the APIs' corresponding MSND pages, the following usage information is available.
Is Crypt32.lib an import library in this case?Header Wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll
Thanks!