Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
I am having an issue with a project that I am working on. Despite the fact that the code is right, I can't build it because I got the following error
Error D8016 '/ZI' and '/Gy-' command-line options are incompatible LoadReport C:\LoadReport\LoadReport\cl
My version of the visual studio is 2015. Any idea would be appreciated.
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)