ant2009
ant2009

Reputation: 22486

Linking a DLL in Visual Studio

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.

Upvotes: 4

Views: 13003

Answers (3)

gary133
gary133

Reputation: 337

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)

Upvotes: 1

jfs
jfs

Reputation: 16768

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.

Upvotes: 2

David Heffernan
David Heffernan

Reputation: 612964

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.

Upvotes: 3

Related Questions