First of all, your error code is incorrect. You probably made a mistake when publishing, as it should be D8016, not D0816. I hope you did not make other mistakes that could mislead us ...
Other than that, the error message is clear:
Visual Studio: D0816 command line error: '/ Ox' and '/ RTC' command line options are incompatible
But you can also see a description of this type of error here:
Command line error D8016
The short answer is - as the error says - you cannot use both of them at the same time. Life is full of compromises, you will need to choose any of them, which is more important for you.
The solution is to disable /RTC to build the release and use it only to build debugging to find problems. See the related documentation , which is also available at the first link above, for more details:
Checking run-time errors is a way to find problems in your working code; See the Practical Guide for more information. Using custom runtime checks.
If you compile your program on the command line using any / RTC compiler options, any pragma optimization instructions in your code will fail silently. This is because runtime checks are not valid in the (optimized) version.
You must use / RTC for development; / RTC should not be used for retail assembly. / RTC cannot be used with compiler optimization (/ O Options (Optimize code)). A program image built with / RTC will be slightly larger and slightly slower than an image built with / Od (up to 5 percent slower than the / Od build).
source share