Sign in to follow this  
Aliii

Quick Debug-Mode Question

Recommended Posts

Aliii    1456

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!

Share this post


Link to post
Share on other sites
fastcall22    10838
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).

Share this post


Link to post
Share on other sites
Aliii    1456

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this