Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the place to add c++ Preprocessor Directives in Visual Studio 2015 Enterprise?

I saw questions similar to this for older versions of Visual Studio but not this latest version. I am following a course on Lynda.com and basically the instructor is trying to use C++ in a pure form that will look the same for students using a visual IDE on Mac. Anyway, the instructor sets up a Working project for teaching the language constructs and such. He right clicks on the project in Visual Studio and under C++ there is Pre-processor section.

I should note that he is using VS 2013 Community Edition. I have a more fully featured version of VS 2015. I don't see that option for defining pre-processor directives on a "project" basis. MS won't let me install 2 copies of VS 2015, but maybe it will let me install VS 2013.

Still, I hope my question makes enough sense as to what we are trying to accomplish, so that I can find the option in VS 2015 Enterprise. Thanks, Bruce

like image 648
Bruce Whealton Avatar asked Oct 28 '15 08:10

Bruce Whealton


People also ask

Where are preprocessor directives placed?

A preprocessor directive is usually placed in the top of the source code in a separate line beginning with the character "#", followed by directive name and an optional white space before and after it.

How do I set preprocessor definitions in Visual Studio?

Select the Configuration Properties > C/C++ > Preprocessor property page. Open the drop-down menu of the Preprocessor Definitions property and choose Edit. In the Preprocessor Definitions dialog box, add, modify, or delete one or more definitions, one per line. Choose OK to save your changes.

Which section of C program contains preprocessor directives?

Usually, every program contains “#” at the top, which is a preprocessor directive that includes files or definitions.


2 Answers

You would need to at least add a .cpp file to your Source Files folder in the the current project that you right will click. That should give you the option you are looking for in Visual Studio 2015.

like image 56
DeveK eSolutions Avatar answered Oct 09 '22 14:10

DeveK eSolutions


Right click on your project. Select Properties. You should see the below menu where you can navigate to Configuration Properties > C/C++ > Preprocessor.

This is how I see it in my Visual Studio Enterprise 2015.

Is this what you're looking for?

enter image description here

like image 45
ThisClark Avatar answered Oct 09 '22 15:10

ThisClark