Fix glad compile issue under MSVC using /MT
MSVC 15 introduced breaking changes to CRT binaries:
https://msdn.microsoft.com/en-us/library/bb531344.aspx#BK_CRT
In this case sscanf_s
(used in glad.c
, line 7699) from stdio.h
has changed and causes a LNK2019 unresolved external symbol error if compiled using MSVC 15 or newer, and the /MT
or /MTd
flag (CMake variable USE_MSVC_RUNTIME_LIBRARY_DLL
set to Off).
The issue is fixed by not including stdio.h
on MSVC, and instead linking against legacy_stdio_definitions.lib
.