Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio: warning C4996: 'fopen': This function or variable may be unsafe. #30

Closed
end2endzone opened this issue Apr 30, 2020 · 1 comment

Comments

@end2endzone
Copy link
Owner

Cpp files generated by bin2cpp uses fopen() function. On Windows, using this function generates a warning message:

warning 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.

The solution is to add the following in cpp files before the first include:

#ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
@end2endzone
Copy link
Owner Author

The following was used instead:

#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif

end2endzone added a commit that referenced this issue May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant