#如果DEBUG总是如此的调试和发布模式 [英] #if DEBUG Always True for DEBUG and RELEASE modes

查看:86
本文介绍了#如果DEBUG总是如此的调试和发布模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,任何code这样的:

For some reason, Any code like:

#if DEBUG
    CallSomeMethod();
#endif

始终是真实的,无论调试或发布模式。任何想法,为什么,什么设置,我可以用它来打开该功能开启或关闭?对于该项目,定义DEBUG常数设置为true。

Is always true regardless of debug or release mode. Any ideas why, and what setting I can use to turn the feature on or off? For the project, define DEBUG constant is set to true.

感谢。

推荐答案

您应该可以在您的项目属性中选择释放模式。用鼠标右键单击您的项目,选择属性,点击窗口左侧的Build选项卡。从那里,你可以取消选中定义DEBUG常数复选框。确保你做到这一点的发布版本,而不是调试模式。

You should be able to select the release mode in your project properties. Right click your project, select Properties and click the build tab on the left of the window. From there, you can uncheck the "define DEBUG constant" box. Make sure you do this for the release build, and not the debug mode.

这篇关于#如果DEBUG总是如此的调试和发布模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆