关于c++预处理器错误(待续)

在编译c++ 时,经常遇见**unsafe的error,我总结了几种解决办法,在这里分享给大家:

1、

错误 3 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. 

解决办法:在项目-》属性-》c/c++-》预处理器-》预处理器定义中添加_CRT_SECURE_NO_WARNINGS即可。

2、

错误 3 error C4996: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::copy': 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' 

解决办法:在同上上面的路径中加入_SCL_SECURE_NO_WARNINGS即可

posted @ 2017-03-08 20:38  valar、  阅读(438)  评论(0编辑  收藏  举报