Skip to content

Fix glad compile issue under MSVC using /MT

Jonathan Kunstwald requested to merge feature/fix-glad-msvc into develop

MSVC 15 introduced breaking changes to CRT binaries:

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.

Merge request reports