Xabi E
Xabi E

Reputation: 381

Linking library (.lib) and (.dll) in visual stucio c++ 2008

I've generated my libmodbus library with visual studio 2008. I can see the .dll and the .lib files.

Now in my project I can use this library if I configure my project:

  1. Linker Additional directories. (.lib folder)
  2. Additional libraries (.lib file)
  3. C/C++ Aditional directories. (Library code path)

With this steps everythings works fine.

But, is it possible to do the same without have the source code? Only with my generated .dll and .lib files?

Upvotes: 1

Views: 482

Answers (1)

gomons
gomons

Reputation: 1976

You do not need source files for use dll. All you need is .dll file. But in this case you should manually get address of every used function. Example for widows you can find here.

Getting address of every function is not very convenient. So you can use .lib file and header files (.h) (but not sources). In C/C++ Additional directories you should specify path to header files.

So you can configure your project:

  1. Linker Additional directories. (.lib folder)
  2. Additional libraries (.lib file)
  3. C/C++ Aditional directories. (Library headers path)

Upvotes: 1

Related Questions