在Visual Studio中默认情况下从项目中删除安全警告(_CRT_SECURE_NO_WARNINGS) [英] Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio

查看:1366
本文介绍了在Visual Studio中默认情况下从项目中删除安全警告(_CRT_SECURE_NO_WARNINGS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法来默认设置所有项目,删除使用函数scanf()时出现的预编译器安全警告。我发现你可以通过在项目选项中添加一行或在代码开头添加#define _CRT_SECURE_NO_WARNINGS。



我发现自己反复创建新项目解决编程竞赛,它真的很烦人(并花费宝贵的时间)添加:

  #ifdef _MSC_VER 
#define _CRT_SECURE_NO_WARNINGS
#endif

或在预编译器中设置

解决方案


$ b

按下Alt-F7或在解决方案资源管理器中右键单击并选择属性



配置:所有配置



点击
预处理器定义行以调用其编辑器



选择
编辑...



将_CRT_SECURE_NO_WARNINGS复制到顶部的预处理器定义白色框中。




Is there a way to set by default for all projects removing the precompiler secure warnings that come up when using functions like scanf(). I found that you can do it by adding a line in the project option or a #define _CRT_SECURE_NO_WARNINGS in the beginning of the code.

I find myself repeatedly creating new projects for solving programming contests and it is really annoying (and takes valuable time) to add:

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

in the beginning of the code, or to set it in the precompiler options every time I start a new project.

Thanks!

解决方案

Mark all the desired projects in solution explorer.

Press Alt-F7 or right click in solution explorer and select "Properties"

Configurations:All Configurations

Click on the Preprocessor Definitions line to invoke its editor

Choose Edit...

Copy "_CRT_SECURE_NO_WARNINGS" into the Preprocessor Definitions white box on the top.

这篇关于在Visual Studio中默认情况下从项目中删除安全警告(_CRT_SECURE_NO_WARNINGS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆