Closed aismann closed 1 year ago
I can confirm the issue on VS2019 64bit
I get the same error when running with:
get the same error when running with: axmol version: Latest Microsoft Visual Studio Community 2022 (64-bit) - Version 17.4.3
Works here on 2022 (64bit): @FlexTheProgrammer can you try it again? Microsoft Visual Studio Community 2022 (64-bit) - Version 17.4.3
xxhash.lib
was build without an error.Works NOT on VS2019 (64bit)
Tried it also with VS2019 (Professional) - Version 16.11.22
(Same steps as above (but for 2019 64bit "of course!")
Result:
Cannot open include file: 'stdalign.h': No such file or directory
Maybe a solution: I found this: https://github.com/raysan5/raylib/issues/2762
and here are the code snippet from miniaudio.h:
#if !defined(_MSC_VER) && defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
#include <stdalign.h>
#define MA_ATOMIC(alignment, type) alignas(alignment) type
#else
#if defined(__GNUC__)
/* GCC-style compilers. */
#define MA_ATOMIC(alignment, type) type __attribute__((aligned(alignment)))
#elif defined(_MSC_VER) && _MSC_VER > 1200 /* 1200 = VC6. Alignment not supported, but not necessary because x86 is the only supported target. */
/* MSVC. */
#define MA_ATOMIC(alignment, type) __declspec(align(alignment)) type
#else
/* Other compilers. */
#define MA_ATOMIC(alignment, type) type
#endif
#endif
The fix should be on xxHash/xxhash.h:
#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */
# include <stdalign.h>
# define XXH_ALIGN(n) alignas(n)
#elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */
/* In C++ alignas() is a keyword */
# define XXH_ALIGN(n) alignas(n)
#elif defined(__GNUC__)
# define XXH_ALIGN(n) __attribute__ ((aligned(n)))
#elif defined(_MSC_VER)
# define XXH_ALIGN(n) __declspec(align(n))
#else
# define XXH_ALIGN(n) /* disabled */
#endif
@halx99 That's the answer from xxhash developer, Any ideas? I'm off now
https://github.com/axmolengine/axmol/blob/dev/cmake/Modules/AXConfigDefine.cmake#L70
We already set C11 in cmake, and the ci tests works, will fire a vs2019 gh action to test it
It's caused by sdk version, in my machine, when use latest windows sdk 22620 works, I will test other sdks, maybe add tests windows sdk version to README
confirmed, required windows sdk version: 10.0.22000+
confirmed, required windows sdk version: 10.0.22000+
Or specific c99 standard by cmake -B build -DCMAKE_C_STANDARD=99
maybe works on older windows sdk
VS2019 64bit build (32bit not tested)
Steps to Reproduce:
Can anybody check it too? VS2019 64bit build shows error above. VS2022 64bit build works correct.