When Building a .lsb File, '/O2' and '/RTC1' Command Line Options Are Incompatible

Updated Sep 19, 2022

Issue Details

I'm trying to build a .lsb file in Visual Studio 2005, but I'm getting the following message: 

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

What am I doing wrong?

Solution

This message appears due to some of the project's properties. Since O2 optimization is incompatible with RTC1, you must verify this setting and try disabling it if it is enabled.

To do this, in Visual Studio go to your Project » Properties (For Debug Configuration):

In the Configuration Properties » C/C++ » Optimization tab set the value of "Optimization" to "Disable (/Od)"

For some additional information on this error please see this link to MSDN.