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

柔情痞子 提交于 2020-01-01 07:45:08

问题


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.


回答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.




回答2:


After changing

C/C++ | General | Debug Information Format

to Program Database (/Zi)

You might need to set the solution configurations to Release.




回答3:


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

I had this problem as well.



来源:https://stackoverflow.com/questions/29336562/visual-studio-error-d8016-zi-and-o2-command-line-options-are-incompatible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!