如何设置视觉工作室在全球注册一些#define? [英] How do I setup visual studio to register some #defines globally?
问题描述
我的意思是,在我的每个源文件中,我必须插入#define NOGDI来停止windows.h包括GDI定义(因为它的BITMAP定义与我的冲突)。
What I mean is, in each of my source files I have to insert #define NOGDI to stop windows.h from including GDI defines (since it's BITMAP define conflicts with mine).
例如
#define NOGDI
#include <windows.h>
不幸的是,我必须在每个单独的源文件中执行此操作,其中包括windows.h,不想做。
我使用Visual Studio 2005,有什么方法,我可以设置它#define全局的东西? (即所有源文件中)。
Unfortunately, I have to do this in every seperate source file which includes windows.h, which I do not want to do. I am using Visual Studio 2005, is there any way I can set it to #define something globally? (i.e. in all of the source files).
推荐答案
项目设置 - > C / C ++ - > Preprocessor - > Preprocessor definitions
Project Settings -> C/C++ -> Preprocessor -> Preprocessor definitions
您可以在项目中定义全局应用于所有源代码的符号。
Here you can define symbols that are applied globally to all source code in your project.
这篇关于如何设置视觉工作室在全球注册一些#define?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!