Visual Studio 2015 using dll directories

Hi everyone, i'm using Visual Studio 2015 and i'm trying to configure my project so that it can use (find) dll files for different platforms/configurations.

The library i want to use is SDL2, when i build it from source i'll get .lib files and SDL2.dll for each x86 / x64, debug / release. So i need to know how to tell Visual Studio to look for the needed .dll file dependent on platform/config.

When i change the properties --> Debugging --> Working Directory, it works, but then the .exe runs in that directory, too. I need a way to avoid that, because i plan to use other resource files which are located in my project directory (and are part of that project).

For example if i have a "text.txt" in my project dir, i want to be able to load it WITHOUT the complete path, just the relative path:
std::fstream f("text.txt", std::ios::in);



my project dir:
../c++/SDL2/[here]

my libraries + dll:
../c++/lib/Win32/Debug/SDL2.dll
../c++/lib/Win32/Release/SDL2.dll
../c++/lib/x64/Debug/SDL2.dll
../c++/lib/x64/Release/SDL2.dll

I cant simply copy one of those .dll into the project dir, because when i change the platform/config, i'd have to re-copy another dll again, thats not very convenient.

Many thanks!
Last edited on
Topic archived. No new replies allowed.