VS2005 出现警告warning C4996: strcpy was declared deprecated 的解决办法
2014-12-16 16:36
483 查看
VS2005 出现warning C4996: strcpy was declared deprecated
在使用VC 2005 的开发者会遇到这样的问题,在使用std命名空间库函数的时候,往往会出现类似于下面的警告: warning C4996: strcpy was declared deprecated 出现这样的警告,是因为VC2005中认为CRT中的一组函数如果使用不当,可能会产生诸如内存泄露、缓冲区溢出、非法访问等安全问题。这些函数如:strcpy、strcat等。 对于这些问题,VC2005建议使用这些函数的更高级的安全版本,即在这些函数名后面加了一个_s的函数。这些安全版本函数使用起来更有效,也便于识别,如:strcpy_s,calloc_s等。当然,如果执意使用老版本、非安全版本函数,可以使用_CRT_SECURE_NO_DEPRECATE标记来忽略这些警告问题。办法是在编译选项 C/C++ | Preprocessor | Preprocessor Definitions中,增加_CRT_SECURE_NO_DEPRECATE标记即可。
转自:/article/6220786.html
相关文章推荐
- VS2005 出现warning C4996: strcpy was declared deprecated
- (转)出现这样的警告 warning C4996: strcpy was declared deprecated
- VS2005 出现warning C4996: strcpy was declared deprecated
- VS2005编译VC6的工程,warning C4996: strcpy was declared deprecated
- Qt出现警告 Unescaped backslashes are deprecated!解决办法
- warning C4996: ''strcpy'' was declared deprecated
- 在VS2005下编译was declared deprecated警告
- warning C4996: strcpy was declared deprecated
- visual studio 2005:warning C4996: strcpy was declared deprecated
- warning C4996: '_snprintf' was declared deprecated 警告信息的消除方法
- 警告C4995解决办法 warning C4995: '_vsnprintf': name was marked as #pragma deprecated
- warning C4996: 'strcpy' was declared deprecated
- MDK中编译出现warning: function "xxx" declared implicitly 警告的解决办法
- qt出现警告 Unescaped backslashes are deprecated!解决办法
- 《转》在VS2005下编译was declared deprecated警告
- qt出现警告 Unescaped backslashes are deprecated!解决办法
- ogre在VS2005英文版下出现“应用程序初始化失败”错误的解决办法
- vs2005 调试时出现“无法附加。绑定句柄无效”的解决办法
- vs2005 调试时出现“无法附加。绑定句柄无效”的解决办法
- vs2005 调试时出现“无法附加。绑定句柄无效”的解决办法