Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
186 views
Welcome To Ask or Share your Answers For Others

1 Answer

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)

see the "To set a custom constant" heading.

Update

Microsoft Documentation on Build Options

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

Project Build Options


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...