vs2012 error c4996: 'fopen': This function or variable may be unsafe

1>------ 已启动生成: 项目: 20130925, 配置: Debug Win32 ------
1>  stdafx.cpp
1>d:code2013092520130925stdafx.cpp(18): error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>          d:vs2012vcincludestdio.h(218) : 参见“fopen”的声明
1>  20130925.cpp
1>  正在生成代码...
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

 

解决方案,项目 =》属性 =》c/c++  =》预处理器=》点击预处理器定义,编辑,加入_CRT_SECURE_NO_WARNINGS,即可

原文地址:https://www.cnblogs.com/wlzy/p/6478884.html