Build Error With Version 2.0.12 Relating to Strings

Hi all,

When trying to build the latest version of SDL (version 2.0.12) with Visual Studio 2017 via CMake, I get the following:

SDL_string.c

F:\build\SDL2\src\SDL2_project\src\stdlib\SDL_string.c(442): warning C4013: ‘wcslcpy’ undefined; assuming extern r
eturning int [F:\build\SDL2_build\SDL2-static.vcxproj] [F:\build\SDL2_project.vcxproj]
F:\build\SDL2\src\SDL2_project\src\stdlib\SDL_string.c(458): warning C4013: ‘wcslcat’ undefined; assuming extern r
eturning int [F:\build\SDL2_build\SDL2-static.vcxproj] [F:\build\SDL2_project.vcxproj]

And then I get linker errors. Version 2.0.10 builds just fine. I am building a 32 bit binary. Am I missing something?

Thanks in advance for any help!

Kind regards,

Philip Bennefall

Revisiting this again, and can verify that it also happens with MSVC 2019. Digging a little deeper in SDL’s CMake script, I see on line 754:

if(LIBC)
if(WINDOWS AND NOT MINGW)
set(HAVE_LIBC TRUE)


And then a little further down in the same scope, there is a list of functions that are all assumed to be available in the C runtime. If I remove wcslcpy and wcslcat from this list, the build succeeds.


I tried to sign up for the bug tracker but am not getting a confirmation email, which is why I am writing on the forum again.


Thanks!


Kind regards,


Philip Bennefall