tags:

views:

78

answers:

2

Or do I need to instruct the compiler explicitly ?

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
+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
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
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
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
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