在我的简单 MFC 窗口应用程序中,我有几行代码从向导生成的编译错误:
I have compile error in my simple MFC window application generated from wizard with several lines of code:
错误 C4996:'strncpy':此函数或变量可能不安全.考虑使用 strncpy_s 代替.要禁用弃用,请使用 _CRT_SECURE_NO_WARNINGS.有关详细信息,请参阅在线帮助.
error C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
我设置Configuration Properties>>C/C++>>Preporocessor>>Preprocessor Definitions>>_CRT_NONSTDC_NO_WARNINGS
但这无济于事.我有另一个非常接近的项目,它只在这个地方生成警告,并且没有 _CRT_NONSTDC_NO_WARNINGS 定义.
But this does't helped. I have another very close project that generates only warning in this place and it has no _CRT_NONSTDC_NO_WARNINGS definition.
项目之间的唯一区别是向导中有几个不同的选项.
Only difference between projects is several different options in wizard.
为什么 _CRT_NONSTDC_NO_WARNINGS 在第一个项目中没有帮助,为什么第二个项目在没有这个定义的情况下编译没有问题?
Why _CRT_NONSTDC_NO_WARNINGS does not helps in first project and why second project compiles without problems without this definition?
添加者
配置属性>>C/C++>>预处理器>>预处理器定义>> _CRT_SECURE_NO_WARNINGS
Configuration Properties>>C/C++>>Preporocessor>>Preprocessor Definitions>> _CRT_SECURE_NO_WARNINGS
这篇关于如何使用_CRT_SECURE_NO_WARNINGS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
读取输入文件,最快的方法?read input files, fastest way possible?(读取输入文件,最快的方法?)
在 C++ 中读取格式化输入的最简单方法?The easiest way to read formatted input in C++?(在 C++ 中读取格式化输入的最简单方法?)
从 .txt 文件读取到 C++ 中的二维数组Reading from .txt file into two dimensional array in c++(从 .txt 文件读取到 C++ 中的二维数组)
如何在 C++ 中模拟按键按下How to simulate a key press in C++(如何在 C++ 中模拟按键按下)
为什么在 cin.ignore() 之后没有 getline(cin, var) 读取Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(为什么在 cin.ignore() 之后没有 getline(cin, var) 读取
scanf 格式输入的 cin 类比是什么?What is the cin analougus of scanf formatted input?(scanf 格式输入的 cin 类比是什么?)