I am converting c++ project from 2008 to 2010, with warning level 4 the "Warning C4653: compiler option 'Optimizations (one or more of /Oawp[y])' inconsistent with precompiled header; current command-line option ignored" warning has been thrown.
If there are no special .cpp files in the project that require special optimization options then all files should have the same options. Reset options that were set on specific files to projets defaults, and then change only the options you like for the whole project.
If you actually need some .cpp files to have special optimization options then turn off precompiled header for those files. This situation is not common in normal projects.
EDIT: Usually we set only project properties: right-click on project (NOT on solution) in Solution Explorer > select Properties. We can however do the same thing for single .cpp files too: right-click on .cpp file in Solution Explorer > Properties. We can do this for several files as well, first select them (ctrl+click, or shift+click, like files in Win Explorer), then get to Properties. You don't even have to close Properties window, but rather select other item while the window is open.
So, right-click on .cpp file > Properties > C/C++ > Precompiled Headers > replace "Use Precompiled Header" with "Not Using Precompiled Headers". That's it. Build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With