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:
Compiling all sources I have referred:
Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio
kmcnamee's answer on How to use use _CRT_SECURE_NO_WARNINGS
Video that solved my problem. https://www.youtube.com/watch?v=qWxGZLjwKL0
Apparently, Security Development Lifecycle (SDL) recommended checks which include enabling additional secure code generation features and extra security-relevant warnings as errors.
The steps to solve this issue are:
1. Go to Project-> "your project name" Properties
2. Under Configuration Properties, go to C/C++
3. Under C/C++, go to Preprocessor
4. Select Preprocessor Definitions and click on Edit from the dropdown menu
5. In the blank space fill out _CRT_SECURE_NO_WARNINGS