I have this error:
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
and similar errors pop up when I use other old C functions. My question is: Is there a way that these errors show up like Warnings, without actually preventing the code from compiling ?
Yes, you can simply right click on "YourFile.cpp" file and choose "Properties"; Click on "Configuration Properties" and in the front part choose "No" for "SDL checks". It will consider these errors as warnings in the next compilation.
However you can prevent this property while creating a new project by unticking the "Security Development Lifecycle (SDL) checks" option.
The same for VS2013!
You must define
_CRT_SECURE_NO_WARNINGS
in the preprocessor settings of your project, or#define _CRT_SECURE_NO_WARNINGS
at the beginning of your file where you usefopen()
. Or just usefopen_s()
instead.