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

C++Visual Studio-2015

C++ Problem Overview


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.

C++ Solutions


Solution 1 - C++

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

Solution 2 - C++

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.

Solution 3 - C++

the same issue got, resolved by changing

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiondim mikView Question on Stackoverflow
Solution 1 - C++PierreView Answer on Stackoverflow
Solution 2 - C++Bo PerssonView Answer on Stackoverflow
Solution 3 - C++N.SANDEEP REDDY sandeepView Answer on Stackoverflow