I always add the _CRT_SECURE_NO_WARNINGS to all of my C/C++ projects in the Preprocessor Definition tab in the Project Properties. There is the drop-down for <edit> and <inherit from parent or project defaults>. How do I change the values of the project defaults. I would think it is an XML file hidden somewhere, or that file needs to be created. Anyone know the location?
-
Use a [Project Property Sheet](http://msdn.microsoft.com/en-us/library/669zx6zc.aspx) – Hans Passant Mar 27 '13 at 01:48
2 Answers
View -> Property Manager, then expand a project and build configuration to see the property sheets being used for that build configuration. Right-click on a property sheet and select Properties to modify the property sheet. I don't recommend modifying the built-in property sheets, however there is a .user property sheet for this purpose. You can also create your own property sheet that defines the preprocessor macro, then add your new property sheet to the list for each build configuration.

- 1,628
- 1
- 11
- 11
-
This is exactly what I was looking for. I modified the Microsoft.Cpp.Win32.user file and now I never have to remember that annoying _CRT_SECURE_NO_WARNINGS definition. – Will Mar 27 '13 at 05:12
My answer and description here will neatly solve this. It uses property sheets, as Hans Passant suggested.
The general setup is to a create a property sheet containing all of the necessary shared settings, optionally in multiple groups with conditions based on build type. You then include the property sheet from each project file.