1.修改no_ms_shit.props文件
__STDC_WANT_SECURE_LIB__=0
改为
__STDC_WANT_SECURE_LIB__=1
2.修改no_ms_shit.vsprops文件(同上)
__STDC_WANT_SECURE_LIB__=0
改为
__STDC_WANT_SECURE_LIB__=1
3.打开[Properties]-->[Configuration Properties]-->[C/C++]-->[General]
设置"treat warnings as Errors"属性为 "no"
4.打开[Properties]-->[Configuration Properties]-->[C/C++]-->[Preprocessor]
向“Preprocessor Definitions" 属性中添加
_CRT_SECURE_NO_WARNINGS
这样就OK了,
__STDC_WANT_SECURE_LIB__=0
改为
__STDC_WANT_SECURE_LIB__=1
2.修改no_ms_shit.vsprops文件(同上)
__STDC_WANT_SECURE_LIB__=0
改为
__STDC_WANT_SECURE_LIB__=1
3.打开[Properties]-->[Configuration Properties]-->[C/C++]-->[General]
设置"treat warnings as Errors"属性为 "no"
4.打开[Properties]-->[Configuration Properties]-->[C/C++]-->[Preprocessor]
向“Preprocessor Definitions" 属性中添加
_CRT_SECURE_NO_WARNINGS
这样就OK了,
本文介绍了解决C/C++编译时出现的安全库警告的方法。通过修改配置文件no_ms_shit.props和no_ms_shit.vsprops中的__STDC_WANT_SECURE_LIB__属性,并调整VS项目的编译选项,确保编译过程中不再出现安全相关的警告信息。
580

被折叠的 条评论
为什么被折叠?



