Open visceralfield opened 5 years ago
Thanks for reporting the issue!
We do run CI against both x86_64-pc-windows-gnu
and x86_64-pc-windows-msvc
on Windows (https://github.com/grovesNL/spirv_cross/blob/master/appveyor.yml#L8) so we should be sure any fix passes on both environments.
Additionally - I can build this successfully with my mingw_w64
install at home, it's only with my MSYS2
based setup on another PC that I run into this issue. I believe mingw_w64
acts more POSIX-ey, but I'm not sure of the exact issue here.
Anybody have any more info on this? Running into it myself now
Still have this bug under Cygwin.
Can confirm that it works with mingw_w64 (g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
)
If possible I'd recommend using MSVC for spirv_cross on Windows for now. I've hit some more issues with MSYS2/MinGW/Cygwin recently which sometimes need workarounds like https://github.com/rust-lang/rust/issues/47048#issuecomment-474118132
The spirv_cross
build.rs
sets the c++ compiler to use the c++14 standard. On POSIX systems this is fine, because those systems will simply implicitly include the POSIX standard as well. This is not the case on Windows while using GCC, however - it uses the strict c++14 standard. This does not include some key functions used byspirv_cross
, namelystrdup
. Attempting to build a crate with spirv-cross as a dependency on x64 Windows 10 with GCC 9.10 results in the following laundry list of errors:I do not have time at the moment to test, but I believe this can be fixed by telling the compiler to use
std=gnu++11
. This will include the relevant POSIX standard headers to enablestrdup
and friends to compile correctly. I will test this when I have time and respond back in this issue if I test a solution that works.