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 Headkaze   Members   -  Reputation: 583

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?



Sponsor:

#2 SeanMiddleditch   Members   -  Reputation: 5868

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.

#3 Bacterius   Crossbones+   -  Reputation: 8885

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.


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#4 Hodgman   Moderators   -  Reputation: 30387

Like
5Likes
Like

Posted 06 April 2014 - 10:07 PM

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