IndustProg
IndustProg

Reputation: 647

How to add DLL reference to a c++ project in a native application?

I want to reference some DLLs in my C++ project in VS2013. I searched and found out that it could be done by right-clicking on project node in solution explorer and select add reference. But when I did as said another window appeared instead of Reference Manager one. Where is the problem? How can I add my DLLs to my project rather than copying them in same folder with .exe output? The reference node also does not appear in solution explorer. I tried show it by clicking "show all files", but it still does not appear!

EDIT: I edited the title according to drescherjm`s comment.

I did right-click on project node and select add references.

enter image description here

Upvotes: 0

Views: 2924

Answers (1)

BugsFree
BugsFree

Reputation: 540

In a native C++ project in Visual Studio in order to not copy the dlls in the folder of the executable you can right-click on the project -> properties -> Debug -> Enviroment and set the following variable: PATH=<folder where the dll is>;%PATH%

I'm not a great expert of C# but what I know is that in a .NET application, in order to use a component in your application, you need to add a reference to it. For default, the dll is locally copy and deployed with your application; to prevent this, you have to register the dll in the GAC(Global Assembly Cache).

Upvotes: 2

Related Questions