Visual C++ - Release compile - warning C4653 - Optimizations inconsistent

Recently, I compiled my solution in release and received several hundred warnings similar to this:

.\dbmView.cpp(7) : warning C4653: compiler option 'Optimizations (one or more of /Oawstgp[y]) or debug checks (one or more of /GZ, /RTCcsu)' inconsistent with precompiled header; current command-line option ignored.



I then did the following steps:

  1. Inspected the properties of the dbmView.cpp and went to Configuration Properties / C/C++ / Command Line and noted all the options. One of these settings was the Optimizations was set to "Disabled (/Od)".
  2. Looked at the project properties and noticed that they were identical. One of these settings was the Optimizations was set to "Disabled (/Od)".
  3. Changed the optimization at the project level to be "Maximize Speed (/O2)", Once applied this also updated the Optimization on the file. to be "Maximize Speed(/O2)". I thought this was odd that it happened automatically. I thought this would have only happened if I had chosen ""
  4. Cleaned the solution and rebuilt. All the warnings were gone for that project.

There are several other projects that are still throwing this warning. Stay tuned.