Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I setup visual studio to register some #defines globally?

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).

e.g.

#define NOGDI #include <windows.h> 

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).

like image 909
user631623 Avatar asked Feb 24 '11 04:02

user631623


People also ask

Is Visual Studio free for individuals?

For individualsAny individual developer can use Visual Studio Community to create their own free or paid apps.

Can you use Visual Studio without a license?

Permitted unlicensed use As a general rule, any person using or accessing software installed via Visual Studio must have a license and it must be of the appropriate type – i.e. a user licensed with Professional cannot access features that are only available with the Enterprise edition.

How do I set up Visual Studio Code?

In this video, we walk you through setting up Visual Studio Code and give an overview of the basic features. Download and install VS Code. Create a new file. See an overview of the user interface. Install support for your favorite programming language. Change your keyboard shortcuts and easily migrate from other editors using keymap extensions.

How do I start a new project in Visual Studio?

To build a C# app, choose Installed, expand Visual C#, and then choose the C# project type that you want to build. After Visual Studio installation is complete, select the Launch button to get started developing with Visual Studio. On the start window, choose Create a new project.

How do I get help from Visual Studio Code?

# On Linux and Windows, choose Help > About. On macOS, use Code > About Visual Studio Code. Why is VS Code saying my installation is Unsupported? # VS Code has detected that some installation files have been modified, perhaps by an extension.

How to install Visual Studio on Windows 10?

Or, open the Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.


1 Answers

Project Settings -> C/C++ -> Preprocessor -> Preprocessor definitions

Here you can define symbols that are applied globally to all source code in your project.

like image 189
tenfour Avatar answered Sep 21 '22 13:09

tenfour