How do I set the path to a DLL file in Visual Studio?
- Go to project properties (Alt+F7)
- Under Debugging, look to the right
- There's an Environment field.
- Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending
PATH=%PATH%;$(ProjectDir)\some-framework\lib
or prepending to the pathPATH=C:\some-framework\lib;%PATH%
- Hit F5 (debug) again and it should work.
The search path that the loader uses when you call LoadLibrary() can be altered by using the SetDllDirectory() function. So you could just call this and add the path to your dependency before you load it.
See also DLL Search Order.
Go through project properties -> Reference Paths
Then add folder with DLL's