sdasdadas
sdasdadas

Reputation: 25096

Using .dll in Visual Studio 2010 C++

I have a problem. I place my .DLL and .LIB file in the same directory as my project, go to Properties -> Common Properties -> Framework and References -> Add New Reference. But the list comes up empty.

Is there something else I should be doing?

Upvotes: 14

Views: 39906

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473407

C++ is not C#. You don't include .dlls in C++ applications by adding "references". Unless it's C++/CLI, but that's not C++.

In C++, you would go, in the project configuration, to Linker->Input->Additional Dependencies. There, you would list the library name plus path to the .lib in question.

Normally, when you build a Windows C/C++ DLL, you also get a .lib. This is an import library; users of the library include (as stated above) that .lib in order to access the DLL. They generally do not load the .dll directly (though there are ways to do that).

Upvotes: 25

Related Questions