By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,359 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,359 IT Pros & Developers. It's quick & easy.

How Do You Turn Off the Debugger?

P: n/a
In C++ within Visual Studio as well as within UNIX ...

I need to turn off/on debug statements. I do not want to comment out these
statements.

I am guessing that I can use:

#ifdef DEBUG
.... statements ...
#endif

I use DEBUG as an identifier.

Where should I define this identifier? Can it be done within a makefile for
UNIX? Or in some text field in Project Settings in Visual Studio 6
Environment?

..... or is this there a better way?

Thank you in advance.
Kathryn (ka**********@sbcglobal.net)
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Clifton M. Bean wrote in
news:hp****************@newssvr24.news.prodigy.com :
In C++ within Visual Studio as well as within UNIX ...

I need to turn off/on debug statements. I do not want to comment out
these statements.

I am guessing that I can use:

#ifdef DEBUG
.... statements ...
#endif

I use DEBUG as an identifier.

Where should I define this identifier? Can it be done within a
makefile for UNIX? Or in some text field in Project Settings in
Visual Studio 6 Environment?

.... or is this there a better way?


define NDEBUG on the compilers comand line -DNDEBUG (*) this has
the advantage that it will turn off the assert() macro from <cassert>.
In your development enviroment you will have to find the the correct
place to make such a define.

For things not covered by assert() use:

#ifndef NDEBUG
// debugging code here
#endif

or if you like to type alot:

#if !defined( NDEBUG )
// debugging code here
#endif

(*) Not all compilers will use this syntax (just most :), check
your compilers documentation.

Rob.
--
http://www.victim-prime.dsl.pipex.com/
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.