C++ Visual Studio 错误 D8016:“/ZI”和“/Gy”命令行选项不兼容
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43141401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
提问by dim mik
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
错误 D8016 '/ZI' 和 '/Gy-' 命令行选项不兼容 LoadReport C:\LoadReport\LoadReport\cl
My version of the visual studio is 2015. Any idea would be appreciated.
我的视觉工作室版本是 2015 年。任何想法将不胜感激。
回答by Pierre
In the Configuration Properties (Project ? Properties
),
在配置属性 ( Project ? Properties
) 中,
"/ZI" is in
“/ZI”在
C/C++ ? General ? Debug Information Format
"/Gy" is in
“/Gy”在
C/C++ ? Code Generation ? Enable Function-Level Linking
回答by Bo Persson
You are choosing "Edit and Continue" (/ZI
) to be able to fix code during debugging, but also "Disable Function-Level Linking" (/Gy-
).
您选择“编辑并继续”( /ZI
) 以能够在调试期间修复代码,但同时也选择“禁用函数级链接”( /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
.
这两者不会一起工作,因为您不能只更改代码中间的一个函数。因此,只需选择其中之一,例如更改/Gy-
为/Gy
.
回答by N.SANDEEP REDDY sandeep
the same issue got, resolved by changing
同样的问题得到了,通过改变解决
Project ? Properties ? C/C++ ? General ? Debug Information Format ? Program Database (/Zi)
项目 ?特性 ?C/C++ ? 一般的 ?调试信息格式 ? 程序数据库 (/Zi)