在Debug下编译代码时,出现如下报错:(但在Release下课顺利通过)
错误 C4996 'std::_Fill_n': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' pclSegment c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility 2811
解决方法:
“属性”-> “c\c++ ”->“ 预处理器 ”-> “预处理器定义” 里面添加:_SCL_SECURE_NO_WARNINGS 即可编译成功 。
【根据提示,在预处理器中添加了: -D_SCL_SECURE_NO_WARNINGS还是不行,注意要把“-D”去掉】