D8016 command line error: '/ O2' and '/ RTC1' command line options are incompatible

I am trying to use /O2 optimization for my project. I checked that the release configuration is enabled (Solution-> Properties-> Configuration Properties-> Configuration-> Release) and set the debug information format to /Zi , but now I don’t know what to do for this error.

+5
source share
1 answer

The Maximize Speed ​​(/ O2) optimization setting is not compatible with the installation of Basic Runtime Checks to generate code.

To change the settings for basic runtime checks:

Solution β†’ Properties β†’ Configuration Properties β†’ C / C ++ β†’ Code Generation β†’ Basic Execution Checks

Set to "Default" and it should work.

enter image description here

+7
source

All Articles