当我选择Debug配置时, DEBUG 常数处于活动状态。当我选择Release配置时, DEBUG 常数不活动。
如何创建自己的配置使它们包含我自己定义的常量。基本上,我想要这样,如果我选择配置FOOBAR有一个常数 FOO 和 BAR 我的项目活跃。
我基本上试图避免在我的项目中插入一堆 #define FOO
解决方案根据本文您可以在构建中定义编译常数
EDITED:要定义构建配置,你可以去Build> Configuration manager,我想你也可以定义编译常量。 p>
When I select the "Debug" configuration, the DEBUG constant is active. When I select the "Release" configuration, the DEBUG constant is inactive.
How can I create my own configurations so that they include my own defined constants. Basically, I want it so that if I select the configuration "FOOBAR" that there is a constant FOO and BAR in my project active.
I'm basically trying to avoid putting in a bunch of #define FOO in my projects, then commenting/uncommenting them out when I need/don't need them.
解决方案According to this article you can define compilation constants in the build tab of your project properties.
EDITED: To define build configurations you can go to Build > Configuration manager and I think you can define compilation constants there too.
更多推荐
如何根据“配置管理器”创建自己定义的常量?
发布评论