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

Some deprecated function #5

Closed
shrinktofit opened this issue Nov 17, 2018 · 5 comments
Closed

Some deprecated function #5

shrinktofit opened this issue Nov 17, 2018 · 5 comments

Comments

@shrinktofit
Copy link

shrinktofit commented Nov 17, 2018

FileReader.hpp use function fopen and strerror, these functions are marked as deprecated in MSVC(for me, Visual Studio 2017). It requires a definition of macro _CRT_SECURE_NO_WARNINGS or use the suggested fopen_s or strerror_s. Why don't you choose std::ifstream?

@kmhofmann
Copy link
Owner

The C API is used for performance reasons. Visual C++ is the only compiler that I know of that "warns" about these functions. Note that they are not deprecated by the ISO C++ standard; technically, Visual C++ is wrong.

When building with CMake, the preprocessor definition you mention is indeed set; see here:
https://github.com/kmhofmann/selene/blob/master/cmake/compiler_options.cmake
Selene should build warning-free.

See here for more information how to build Selene using CMake:
https://github.com/kmhofmann/selene/blob/master/docs/building.md

Alternatively, it should be possible to install a released version of Selene using vcpkg; see here:
https://github.com/kmhofmann/selene/blob/master/docs/installation.md

@shrinktofit
Copy link
Author

shrinktofit commented Nov 19, 2018

Alternatively, it should be possible to install a released version of Selene using vcpkg; see here:
https://github.com/kmhofmann/selene/blob/master/docs/installation.md

The errors appeared when using the vcpkg.

I disable this warning by add include directive:

#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif
#include <selene/img_io/IO.hpp>

@kmhofmann
Copy link
Owner

Yep, you're right. Can you double check if the changes made in 35264eb fix all the warnings, after removing the pragma in your client code again? I can't test behavior on Windows right now, but I think this should work.

@kmhofmann kmhofmann reopened this Nov 19, 2018
@shrinktofit
Copy link
Author

It works for me. Thx

@kmhofmann
Copy link
Owner

Merged. #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants