why does VC++ need .lib files for linking to functions in a dll

  • Thread starter Thread starter Bruno van Dooren
  • Start date Start date
B

Bruno van Dooren

Hi all,

i am working on a crossplatform shared library (so on linux and dll on
windows).

if i want to use that library in an app, on linux i only need to tell gcc to
use the library as an input.
on windows i need to either use the .lib file, or load the library manually.
what is the reason that VC++ can not use the dll directly for linking?

kind regards,
Bruno.
 
Hi all,

i am working on a crossplatform shared library (so on linux and dll on
windows).

if i want to use that library in an app, on linux i only need to tell gcc to
use the library as an input.
on windows i need to either use the .lib file, or load the library manually.
what is the reason that VC++ can not use the dll directly for linking?

Because the dynamic loading methods were designed diferrently, and the
link information is not present in a basic DLL.

You can use functions in basic DLLs directly (without linking to the
LIB file) using LoadLibrary or LoadLibraryEx and GetProcAddress, as
long as you have the function prototypes.

You can use #import for ActiveX style DLLs, and no LIB file is
required.
 
Back
Top