Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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: 1447

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: 4388

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).
c3RhdGljIGNoYXIgeW91cl9tb21bMVVMTCA8PCA2NF07CnNwcmludGYoeW91cl9tb20sICJpcyBmYXQiKTs=

#3 Aliii   Members   -  Reputation: 1447

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