I'm trying to get TDM build working on my laptop.
Just installed VC2022, and now I get the following error:
1>OpenAL32.lib(alc.obj) : error LNK2019: unresolved external symbol __imp___std_init_once_begin_initialize referenced in function alcOpenDevice
1>OpenAL32.lib(alc.obj) : error LNK2019: unresolved external symbol __imp___std_init_once_complete referenced in function alcOpenDevice
Searching has lead me to this issue:
https://developercommunity.visualstudio.com/t/-imp-std-init-once-complete-unresolved-external-sy/1684365
https://github.com/microsoft/STL/issues/2655
Obviously, developers accidentally broke binary compatibility on minor update of Visual C++ compiler (in version: 17.2 Preview 2).
While they are seeking the way to fix it, I'd recommend to not update your Visual Studio in the near future.
If you already suffer from this issue, then you can workaround it by adding the following e.g. to the end of Lib.cpp:
#if defined(_M_IX86)
#pragma comment(linker, "/ALTERNATENAME:__imp____std_init_once_begin_initialize@16=__imp__InitOnceBeginInitialize@16")
#pragma comment(linker, "/ALTERNATENAME:__imp____std_init_once_complete@12=__imp__InitOnceComplete@12")
#elif defined(_M_X64)
#pragma comment(linker, "/ALTERNATENAME:__imp___std_init_once_begin_initialize=__imp_InitOnceBeginInitialize")
#pragma comment(linker, "/ALTERNATENAME:__imp___std_init_once_complete=__imp_InitOnceComplete")
#endif
I'm not yet sure if we should commit this workaround, to be honest
In theory, it does not break build, but adds a last resort option: if linker doesn't find symbol {nameonleft}, then it tries to use symbol {nameonright} instead of it.