在 windows 平台下的 visual studio IDE,使用 fopen 等 CRT 函数(C runtime library(part of the C standard library)),就会出现一些警告信息,如下:

warning 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:右击工程 - 属性 - 配置属性 - C/C++ - 命令行,命令行增加 /D _CRT_SECURE_NO_WARNINGS

  • 法2:自己在头文件中定义


    #define _CRT_SECURE_NO_WARNINGS

warning C4996: 'fopen': This function or variable may be unsafe.(_CRT_SECURE_NO_WARNINGS)的更多相关文章

  1. 【Visual Studio】error c4996: 'fopen': This function or variable may be unsafe(转)

    原文转自 http://blog.csdn.net/zhangyuehuan/article/details/12012635 [解决方案]项目 =>属性 =>c/c++  =>预处 ...

  2. vs的【warning C4996:'fopen': This function or variable may be unsafe】解决方案

    编译警告:warning C4996 与 Security Enhancements in the CRT 将过去的工程用VS2005打开的时候.你有可能会遇到一大堆的警告:warning C4996 ...

  3. “warning C4996: 'fopen': This function or variable may be unsafe”和“LINK : fatal error LNK1104”的解决办法

    程序有时编译出现警告C4996,报错:  warning C4996: 'fopen': This function or variable may be unsafe. Consider using ...

  4. 配置OpenCV产生flann\logger.h(66): error C4996: 'fopen': This function or variable may be unsafe问题[zz]

    使用vs2012/2013配置opencv编译出现问题: 1>------ 已启动生成: 项目: Win32ForOpenCV245, 配置: Debug Win32 ------ 1> ...

  5. error C4996: 'fopen': This function or variable may be unsafe.

    vs2013中错误提示信息: error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s ...

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

    1>------ 已启动生成: 项目: 20130925, 配置: Debug Win32 ------1>  stdafx.cpp1>d:\code\20130925\201309 ...

  7. error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead解决方案

    vs2012使用c语言函数fopen操作文件时报错: 错误 1 error C4996: 'fopen': This function or variable may be unsafe. Consi ...

  8. warning C4996: 'sprintf': This function or variable may be unsafe

    选项Project   |   Configuration   Properties   |   C/C++   |   Preprocessor   |   Preprocessor   Defin ...

  9. warning C4996: 'strcpy': This function or variable may be unsafe.

    mkdir 写成  _mkdir strcpy 写成为 strcpy_s 或是在项目处右击-->属性-->C/C++-->预处理器-->在预处理器定义后添加";_CR ...

随机推荐

  1. jqXHR对象

    //$.ajax()返回的对象就是jqXHR对象 var jqXHR = $.ajax({ type:'post', url:'test.php', data:$('form').serialize( ...

  2. 基于面向对象js的弹窗的组件的开发案例

    var aInput = document.getElementsByTagName("input"); 2 aInput[0].onclick = function() { 3 ...

  3. 四、Docker+Tomcat

    原文:四.Docker+Tomcat 一.下载Tomcat镜像 具体可以search 搜索tomcat 相关镜像 docker pull sonodar/jdk8-tomcat8 二.创建容器 doc ...

  4. Apache httpd.conf 配置文件语法验证

    Apache 的 httpd.conf文件改动之后,必须重新启动server才干生效. 有时server在提供服务的时候,直接更改配置,重新启动服务.会带来非常大的危急性. 假设能在改动配置之后,先验 ...

  5. Android怎样实现毛玻璃效果之Android高级模糊技术

    自从iOS系统引入了Blur效果,也就是所谓的毛玻璃.模糊化效果.磨砂效果.各大系统就開始竞相模仿,这是如何的一个效果呢,我们先来看一下,如以下的图片: 效果我们知道了,怎样在Android中实现呢. ...

  6. 16、cgminer学习之:pthread_mutex_init和pthread_cond_init

    1.原理 假设有两个线程同时访问一个全局变量 n,这个全局变量的初始值等于0. Int  n = 0 ; 消费者线程 A 进入临界区,访问 n,A 必须等到 n 大于 0 才能接着往下执行,如果 n= ...

  7. Dynamics CRM 2016 Web API 消息列表

    Function Name Description CalculateTotalTimeIncident Function Calculates the total time, in minutes, ...

  8. js进阶 14-2 如何用ajax验证登陆状态(这里用load方法)

    js进阶 14-2 如何用ajax验证登陆状态(这里用load方法) 一.总结 一句话总结:$('#test').load('test.php?password=1234560'),这样就get方式提 ...

  9. LeetCode Algorithm 04_Median of Two Sorted Arrays

    There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted ...

  10. postman--基本使用1

    本文转自:http://blog.csdn.net/five3/article/details/53021084 HTTP的接口测试工具有很多,可以进行http请求的方式也有很多,但是可以直接拿来就用 ...