Jump to content

  • Log In with Google      Sign In   
  • Create Account

Debug output options for Visual Studio using Release


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1   Members   -  Reputation: 607

Like
0Likes
Like

Posted 06 April 2014 - 07:49 PM

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?



#2   Crossbones+   -  Reputation: 16040

Like
4Likes
Like

Posted 06 April 2014 - 09:35 PM

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.

Game Developer, C++ Geek, Dragon Slayer - http://seanmiddleditch.com

C++ SG14 "Games & Low Latency" - Co-chair - public forums

Wargaming Seattle - Lead Server Engineer - We're hiring!


#3   Crossbones+   -  Reputation: 12965

Like
3Likes
Like

Posted 06 April 2014 - 09:45 PM

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.”


#4   Moderators   -  Reputation: 48712

Like
5Likes
Like

Posted 06 April 2014 - 10:07 PM

*
POPULAR

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.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS