Jump to content

  • Log In with Google      Sign In   
  • Create Account

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   Members   

1455
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!


#2   Moderators   

9742
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).
zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

#3   Members   

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