diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt index 14c48ea9b..139703c0c 100644 --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt @@ -117,6 +117,12 @@ elseif(SFML_OS_IOS) target_link_libraries(sfml-graphics PRIVATE z bz2) endif() +# starting from Visual Studio 2015, inline versions of some C functions are used; for compatibility link this library +# see https://docs.microsoft.com/en-us/cpp/porting/overview-of-potential-upgrade-issues-visual-cpp?view=msvc-160#libraries +if(SFML_COMPILER_MSVC AND MSVC_VERSION GREATER_EQUAL 1900) + target_link_libraries(sfml-graphics PRIVATE legacy_stdio_definitions.lib) +endif() + sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") target_link_libraries(sfml-graphics PRIVATE Freetype)