Linking a DLL in Visual Studio

12,629

Solution 1

When you create the DLL there should be a .lib file created for the purpose of dynamic linking. You can use these just as you would static .lib files.

Solution 2

This article explains Windows dlls well.

The .LIB file associated with a DLL describes what (exported) symbols are present in the DLL, together with their locations.

Solution 3

To put it simply:

  • When you link: you Need Lib, not DLL
  • When you run it: you need dll, not lib (Put the DLL with your executable)
Share:
12,629
ant2009
Author by

ant2009

Updated on June 04, 2022

Comments

  • ant2009
    ant2009 about 2 years

    I'm using Visual Studio C++ 2005 on Windows XP.

    I have created a DLL shared library using Visual Studio C++ 2005.

    However, I am not sure how to link it. Normally I have just created the static libraries (*.lib).

    Do I link the same way I would when linking a library. By using the properties C/C++ and linker general properties and selecting the path for the headers and library paths?

    Many thanks for any advice.