Visual Studio error D8016: '/ZI' and '/O2' command-line options are incompatible

27,276

Solution 1

Go to the project's property page and change the value for:

C/C++ | General | Debug Information Format

To something other than "Program Database for Edit and Continue (/ZI)"

For example, "Program Database (/Zi)" should work.

Solution 2

After changing

C/C++ | General | Debug Information Format

to Program Database (/Zi)

You might need to set the solution configurations to Release.

Solution 3

Verify that under Linker -> Debugging says Generate Debug Info -> No.

I had this problem as well.

Share:
27,276
Nathan Schmidt
Author by

Nathan Schmidt

Updated on March 09, 2020

Comments

  • Nathan Schmidt
    Nathan Schmidt about 4 years

    Visual Studio error D8016: '/ZI' and '/O2' command-line options are incompatible

    I'm using optimization for the first time with C++. When I 'build solution' I keep getting this error. In the property pages, I have configuration set to Release Under project/properties/c++/optimization I tried all the options except for disable. Under project/properties/c++/General I also tried all the options under 'Debug Information Format' (assume 'None' is a good choice?). I think it might have something to do with the linker settings, but still don't know what to do.