Re: dlls versus lib files - are they the same?
WISEMANOFNARNIA wrote:
I have an old C project that I am now compiling in Visual Studio. It
uses a software development kit that interacts with Microsoft Excel.
In that kit is a file called "xlcall32.lib". So I link to that lib
file, and the program does compile.
But then, when I run the program, it tells me it cannot find
"xlcall32.dll". But I thought that "lib" files are replacements for
"dlls". In other words I though you need one or the other, not both.
You need both if your program uses dynamic library (DLL). The .lib file
comes in during linking, the .dll file - during running. You need the
..lib file for linking if the loading of the .dll is *implicit*. You
don't need the .lib if you use 'LoadLibrary', 'GetProcAddress', and
'FreeLibrary' yourself.
BTW, the .lib file that *accompanies* a DLL is called "an export
library". It doesn't contain object modules, just special instructions
to the linker on how the external references from the DLL are going to
be resolved. Read up on DLLs on MSDN, it helps getting the information
from the horse's mouth, so to speak.
Why, if I supply "xlcall32.lib", do I get a message that
"xlcall32.dll" is missing?
Not sure how to answer this... Because it's truly missing, maybe?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask