Or do I need to instruct the compiler explicitly ?
views:
78answers:
2
+2
Q:
Is it true that there will always be a .lib(import library) associated with the .dll you build?
A:
It normally happens automatically (for any DLL or executable that exports at least one symbol). Edit: at least with the compilers I've used; I suppose there could be a compiler that didn't produce one automatically -- I'm pretty sure there are at least a few versions of a few compilers that I haven't tried/used.
Jerry Coffin
2010-07-25 04:52:19
+1
A:
With a user name like "ieplugin" the answer would probably be No. COM servers don't have .lib files. For regular DLLs, the .lib file is produced by the linker, not the compiler. The /IMPLIB option generates them.
Hans Passant
2010-07-25 05:03:14
While you don't normally *use* the .lib file with a COM server, it *is* normally produced. Just for example, if you create a default "ActiveX Control" project with MSVC++, and compile it, the build log will contain a line like: "1> Creating library c:\c\projects\whatever\Debug\whatever.lib and object c:\c\projects\whatever\Debug\whatever.exp"
Jerry Coffin
2010-07-25 05:07:22
Is it true that we can only use `.dll` either by the import library or load the `.dll` programatically(`c/c++`),no 3rd way?
ieplugin
2010-07-25 05:45:39
ieplugin, as far as I know, yes. What kind of 3rd way would you like to use? I think a lot of cool things can be done by loading DLLs at runtime already and by using them as interchangable/patchable libs.
abenthy
2010-07-25 07:20:29
Mingw can link directly to the DLL in most cases, it doesn't *require* an explicit import lib (although gcc import libs are *.a files, not .lib, but the idea is the same).
rubenvb
2010-07-25 10:39:34