Command line warning D9035: option 'Gm' ha

2020-07-01 09:30发布

I am getting the warning message "cl : Command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release" while building my project with Visual Studio 2017 latest update 15.9.2. How to resolve this warning?

7条回答
太酷不给撩
2楼-- · 2020-07-01 09:36

just add this above your deprecated function

#pragma warning (disable : 4996);

example

#pragma warning (disable : 4996);
your_deprecated_function(); 
查看更多
Juvenile、少年°
3楼-- · 2020-07-01 09:37

According to the documentation

You may safely remove this option from your projects.

查看更多
Rolldiameter
4楼-- · 2020-07-01 09:38

Try selecting <inherit from parent or project defaults> for the Enable Minimal Rebuild option (under C/C++ > Code Generation). After this, the option should show No (/Gm-), not in bold. Make sure you do this for your project(s) (you could have several projects in the solution), and all property pages they inherit from.

I had the same problem using Visual Studio 2019, in the end the problem was in a second project I had in the same solution, that had the option set to Yes (/Gm).

查看更多
SAY GOODBYE
5楼-- · 2020-07-01 09:40

UI did not work for me either. In the .vcxproj file search: "MinimalRebuild" I had missed a second one under Debug|Win32

查看更多
够拽才男人
6楼-- · 2020-07-01 09:41

Happened for me too. Did not manage to fix it through UI. In the end I searched for "MinimalRebuild" in all project files and removed it manually - that helped

查看更多
聊天终结者
7楼-- · 2020-07-01 09:42

Properties > C\C++ > Code Generation > Enable Minimal Rebuild: DELETE value - and there is no warning.

查看更多
登录 后发表回答