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:
- 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)".
- Looked at the project properties and noticed that they were identical. One of these settings was the Optimizations was set to "Disabled (/Od)".
- 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 "
" - 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.
Popular Articles
Last viewed:
- Get the list of ODBC data source names programatically using C#
- Dynamically retrieving the executing assembly version attribute - C#
- Tutorial for Configuring Silverlight 4, Entity Framework and WCF RIA Services in Separate Component Assemblies (DLL’s)
- Microsoft Word Spell Checker Doesn't Check Cut and Pasted Text
- Deploy Crystal Reports 2008 Run-time on Remote Server
- C# Free Component to Generate PDF - Convert HTML to PDF

Recent comments
8 hours 54 min ago
23 hours 47 min ago
3 days 11 hours ago
4 days 11 hours ago
6 days 12 hours ago
1 week 2 hours ago
1 week 13 hours ago
1 week 18 hours ago
1 week 22 hours ago
1 week 3 days ago