【VS / C++】#pragma warning(disable:4996) 无法消除 C4996 std::copy::_Unchecked_iterators::_Deprecate 的解决方法

Severity	Code	Description	Project	File	Line	Suppression State
Error	C4996	'std::copy::_Unchecked_iterators::_Deprecate': Call to 'std::copy' 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'	******	d:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility	2372	

方法:在 Project → ***(项目名) Properties 中,依次打开 Configuration Properties → C/C++ → Preprocessor,在 Preprocessor Definition 中,增加:

_SCL_SECURE_NO_WARNINGS

在这里插入图片描述
然后确定即可。

猜你喜欢

转载自blog.csdn.net/COFACTOR/article/details/111415098