![]() |
| | #1 | |
| Registered User Join Date: Apr 2009
Posts: 34
| What's an import library? 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. Quote:
Thanks! Last edited by chiefmonkey; 06-19-2009 at 04:57 PM. | |
| chiefmonkey is offline | |
| | #2 |
| Registered User Join Date: Jun 2008 Location: RING 0
Posts: 462
| The compiler still requires the definitions of exported functions. These definitions will have special compiler instructions however to let it know the rest of the definition will come at runtime. |
| valaris is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| import from python library | zoupi | C Programming | 2 | 05-11-2009 10:09 AM |
| dllimport | George2 | C++ Programming | 15 | 02-23-2008 04:35 AM |
| DLL generated but related import library is missing? | George2 | C Programming | 0 | 08-18-2006 12:13 AM |
| very weird .h problem | royuco77 | C++ Programming | 1 | 09-11-2005 07:55 AM |