Tuesday, October 14, 2014

[Trouble shooting] error C4996 : 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instread. to disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.


This is not an error but an warning.


If you use old C standard functions Visual Studio blocks to complie because it is unsafe for security reasons.

Basically 'using more save functions' is recommended like fopen_s().


If you wanna other solution, change setups as follows :

Solution.

1. Use 'fopen_s' instead of 'fopen'.

2. Permit '_CRT_SECURE_NO_WARNINGS' by following procedures.

 Select 'Project' -> 'Properties' -> 'Configuration Properties' -> 'C/C++' -> 'Preprocessor' -> add ';_CRT_SECURE_NO_WARNINGS' in the 'Preprocessor Definitions' to turn of warnings.

No comments:

Post a Comment