Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 18 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Quick Debug-Mode Question


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
2 replies to this topic

#1 Aliii   Members   -  Reputation: 1452

Like
0Likes
Like

Posted 08 February 2013 - 03:28 PM

I want to be able to switch my code easily into "debug mode". I guess you normally put things like this into your code:

 

....

....

 

#ifdef DEBUG_MODE
    //some error-checking
#endif
....
.....
 
...but do I need a new header with "#define DEBUG MODE" and include it in almost every CPP file or is there some trick, a hint to the compiler or something?
Thanks!


Sponsor:

#2 fastcall22   Crossbones+   -  Reputation: 6251

Like
3Likes
Like

Posted 08 February 2013 - 03:34 PM

If you're using Visual Studio, then go to the project properties and modify the preprocessor definitions field in the C/C++ folder. Be sure only the "Debug" configuration is set.

AFAIK, there's already a widely-accepted define "NDEBUG" that is set when optimizations are configured for the build (i.e., not-debug mode).
gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#3 Aliii   Members   -  Reputation: 1452

Like
0Likes
Like

Posted 08 February 2013 - 03:43 PM

If you're using Visual Studio, then go to the project properties and modify the preprocessor definitions field in the C/C++ folder. Be sure only the "Debug" configuration is set.

AFAIK, there's already a widely-accepted define "NDEBUG" that is set when optimizations are configured for the build (i.e., not-debug mode).

 

Thanks! Im using Netbeans but Ive found it in the project options.






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