nursmaul nursmaul - 1 year ago 146
C++ Question

No support for VS2015 in OpenGL GLI?

I am trying to use 'OpenGL Image' library( )( abbreviated as GLI, like GLM ) in my Visual Studio 2015 project, but have no luck to have it successfully compiled due to the error as follows:

c:\users\sabro_000\downloads\gli-\gli./core/load.inl(32): 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.

The error above is not at all new to me, since I have been seeing this error message many times always I tried to use deprecated
in VS2015. What I have been doing whenever I see this message is not going into
, but rather just use
instead, as the message suggests because that's easier to solve it.

But now I get this error in OpenGL GLI, and would like to know how is anyone using OpenGL GLI on VS2015, getting rid of this error.

Answer Source

First off, it's a warning, not an error (at least on default settings). This means you can build and run your code just fine even with this warning.

Second, the simple solution is to do as the warning says and #define _CRT_SECURE_NO_WARNINGS. Note that the "more secure" functions ending in _s were never really adopted by C standard library vendors other than Microsoft, and there is a proposal to remove them from the standard again. You're probably better off not using them.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download