如何根据“配置管理器”创建自己定义的常量? [英] How do I create my own defined constants based on the "Configuration Manager"?

查看:196
本文介绍了如何根据“配置管理器”创建自己定义的常量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我选择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.

这篇关于如何根据“配置管理器”创建自己定义的常量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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