Why does Visual Studio 2013 error on C4996?

后端 未结 6 1653
半阙折子戏
半阙折子戏 2020-12-01 04:35

In previous versions of Visual Studio using functions like _sleep or strncpy just outputs a warning. In the latest version, it\'s suddenly an error:

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-01 04:56

    Just to add to this, _CRT_NONSTDC_NO_DEPRECATE worked for me in VS2019. _CRT_SECURE_NO_WARNINGS alone did not clear this for me (I have both defined).

    Similar to the other answers, this may be added by right-clicking the project in Solution Explorer, Then going to Properties->Configuration Properties->C/C++->Preprocessor->Preprocessor Definitions->Edit... then adding the line _CRT_NONSTDC_NO_DEPRECATE.

提交回复
热议问题