使用vs2012配置opencv编译出现问题:error C4996: 'fopen': This function or variable may be unsafe.

使用vs2012配置opencv编译出现问题error C4996: 'fopen': This function or variable may be unsafe.

编译结果如下:1>------ 已启动生成: 项目: LoadPicture, 配置: Debug Win32 ------

1>  stdafx.cpp

1>  LoadPictureDlg.cpp

1>d:\opencv\opencv\build\x86\vc11\include\opencv2\flann\logger.h(66): 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>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\stdio.h(218) : 参见“fopen”的声明

1>  LoadPicture.cpp

1>d:\opencv\opencv\build\x86\vc11\include\opencv2\flann\logger.h(66): 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>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\stdio.h(218) : 参见“fopen”的声明

1>  CvvImage.cpp

1>d:\opencv\opencv\build\x86\vc11\include\opencv2\flann\logger.h(66): 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>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\stdio.h(218) : 参见“fopen”的声明

1>  正在生成代码...

========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

 

解决办法如下:

找到Debug属性页C/C++下得预处理器


在预处理定义的

WIN32

_WINDOWS

_DEBUG下添加_CRT_SECURE_NO_WARNINGS


这个问题只有在Visual Studio 2012中才会有,2010中只是一个warning

我的opencv246


评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值