解决方案范围内的#define [英] Solution-wide #define

查看:91
本文介绍了解决方案范围内的#define的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在全球范围内声明的#define?

Is there a way to globally declare a #define?

就像我希望有一个具有比如一个文件,

Like I want to have a file that has for instance,

#define MONO

和我想所有的源代码文件,要知道,这预处理器指令定义。我将如何做到这一点。

and I want all source-code files to know that this pre-processor directive is defined. How would I achieve that?

推荐答案

更​​新:你不能做一个解决方案范围的定义据我所知,然而答案下面是可行的对每个项目的基础。

Update: You cannot do a "solution-wide" define afaik, however the answer below is workable on a per-project basis.

您设置它们在你的编译属性或构建选项:

You set them in your Compilation Properties or Build options:

http://msdn.microsoft.com/en-US/library/76zdzba1(v=VS.80).aspx (VS2008)
的http:// MSDN。 microsoft.com/en-US/library/76zdzba1(v=VS.100).aspx (VS2010)

http://msdn.microsoft.com/en-US/library/76zdzba1(v=VS.80).aspx (VS2008) http://msdn.microsoft.com/en-US/library/76zdzba1(v=VS.100).aspx (VS2010)

看到要设置自定义常量标题

see the "To set a custom constant" heading.

更新

在构建选项微软文档

您得到通过右键单击该项目,并从菜单中选择属性生成选项

You get to the build options by right-clicking the project and selecting properties from the menu.

这篇关于解决方案范围内的#define的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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