Skip to main content
GameDev.net gamedev.net
🔒 Locked

Debug output options for Visual Studio using Release

Started by Headkaze Apr 7, 2014 at 1:49 AM 2 replies 2.7k views
Original Post
Headkaze
Headkaze

I have a project I'm working on that has folders relative to the "Release" folder that my application requires. This means I am constantly compiling in Release mode even during debugging.

The issue is I want to be able to toggle debug output on and off.

What should I do to deal with this situation? Should I set the Debug and Release output folders the same directory and use Debug when I want Debug output? Or should I use the Release mode and setup a #define for toggling Debug output?

SeanMiddleditch
SeanMiddleditch
A common approach is to make a common output directory and then modify the output names for release vs debug names. For instance, you might generate Foo.exe and FooDebug.exe. DLLs/libraries often have a 'd' suffix on debug builds as well.

Another very common approach is to just not make things relevant to the output directories. You can use a post-build step to copy DLLs into the output directory and use a config file or other means to set resource paths outside of the output directory.
Sean Middleditch – Game Systems Engineer – Join my team!
Bacterius
Bacterius

Just don't make your application depend on stuff inside a Release folder - copy whatever is needed (in the proper debug/release configuration) inside a folder for each build configuration, and run it there (via a build script or other). That way you don't have hidden dependencies in your build system and can build in debug or release mode without headaches.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”
Hodgman
Hodgman

Go into your project properties, debug tab, and set up the "Working directory" properly. This is the location that the exe will be run from. By default, it will run from the same location as the exe (e.g. build/Release, build/Debug, etc) but you should configure it to the path where the exe will actually exist in a real installation so that it behaves like a real install would.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.