Automatic #defines according to Debug/Release config in Visual Studio

前端 未结 4 1648
醉梦人生
醉梦人生 2020-12-24 11:07

I have debug output in my program like this:

#define DEBUG
...
#ifdef DEBUG
    std::cout << \"[RE_words] \" << m_re << std::endl;
#endif
<         


        
4条回答
  •  臣服心动
    2020-12-24 12:13

    Use _DEBUG. Visual C++ defines this for a Debug configuration. Check out the preprocessor directives for the Debug Configuration in your project's properties dialog.

提交回复
热议问题