I have debug output in my program like this:
#define DEBUG
...
#ifdef DEBUG
std::cout << \"[RE_words] \" << m_re << std::endl;
#endif
<
I too thought I just had to look at the preprocessor property and remove _DEBUG. Visual Studio tries to help out by setting _DEBUG if you select one of the debug run-time library options.
On the project property page Configuration Properties\C/C++\Code Generation the option selected for Runtime Library affects several defines. When selecting a debug library (/MTd or /MDd) the _DEBUG define is set.
See MSDN /MD, /MT ... for more info on the switches. There are several #defines that are set based on these options. They are pretty invisible when trying to find who sets a #define before you even include any header files!!