今天在vs2013编程中遇到这样的错误: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 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. 首
楼主最近在学习图像处理,所用平台为VS2017+opencv3.2.0。调试程序时,报错如下: This function or variable may be unsafe. Consider using fopen_s instead.To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for detail
编译报错: error: ‘fopen_s‘ was not declared in this scope 解决办法: 不同操作系统对于函数的定义、名称以及参数有所不同,需要在文件前加入代码: #ifdef __unix#define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename), (mode)))==NULL