Solution-wide #define

前端 未结 11 2299
予麋鹿
予麋鹿 2020-12-05 09:29

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-

11条回答
  •  臣服心动
    2020-12-05 09:36

    I don't know of a solution wide definition, but I was able to quickly add a preprocessor definition to all projects by doing the following:

    1. hold ctrl and select each project
    2. right click on any selected project and choose Properties
    3. go to C/C++ --> Preprocessor
    4. click the little down arrow beside Preprocessor Definitions
    5. choose
    6. add my definition after
    7. OK out of the menus

    I'm using Visual Studio Community 2019 with a C code base.

提交回复
热议问题