Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 337
sdasdadas Avatar asked Aug 21 '11 04:08

sdasdadas


1 Answers

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).

like image 195
Nicol Bolas Avatar answered Sep 18 '22 11:09

Nicol Bolas