Using .dll in Visual Studio 2010 C++
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).
sdasdadas
Updated on July 27, 2020Comments
-
sdasdadas almost 4 years
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?
-
sdasdadas over 12 yearsWhy is the MSDN documentation so vastly different?
-
wilx over 12 yearsVS 2010 has made the references work even for pure C++ projects. Though I do not know why is that it does not work for you.
-
Nicol Bolas over 12 yearsI'm still on VC2008, so there's that.
-
user1703401 over 12 yearsIt is the same in both, it lists other projects. The OP has only one project in his solution, that's why the list is empty.
-
fIwJlxSzApHEZIl almost 12 yearsSo how do you go about linking an external .DLL file then when there is no visual studio solution for the .DLL file in question?