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

In the Configuration Properties (Project ➔ Properties),

"/ZI" is in

C/C++ ➔ General ➔ Debug Information Format 

"/Gy" is in

C/C++ ➔ Code Generation ➔ Enable Function-Level Linking

You are choosing "Edit and Continue" (/ZI) to be able to fix code during debugging, but also "Disable Function-Level Linking" (/Gy-).

Those two will not work together, as you cannot just change one function in the middle of the code. So just choose one of them, like changing /Gy- to /Gy.


the same issue got, resolved by changing

Project ➔ Properties ➔ C/C++ ➔ General ➔ Debug Information Format ➔ Program Database (/Zi)