Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-compiled windows binary won't work because of missing libstdc++-6.dll #137

Closed
hannobraun opened this issue Mar 21, 2020 · 3 comments
Closed

Comments

@hannobraun
Copy link

I'm working on a project that has spirv_cross in its dependency tree. Everything's fine on my Linux machine, but when I try to cross-compile a Windows executable, it can't be executed because libstdc++-6.dll is missing. I was able to verify this under Linux using Wine.

The problem can be reproduced easily using the example in this repository:

cargo install cross
cross build --package examples --bin glsl --target=x86_64-pc-windows-gnu
wine target/x86_64-pc-windows-gnu/debug/glsl.exe

This results in the following error message on my machine:

002b:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\hanno\\Projects\\vndf\\vendor\\spirv_cross\\target\\x86_64-pc-windows-gnu\\debug\\glsl.exe") not found
002b:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\hanno\\Projects\\vndf\\vendor\\spirv_cross\\target\\x86_64-pc-windows-gnu\\debug\\glsl.exe" failed, status c0000135

This matches the report from a user testing on Windows.

I tried fixing this, but was not successful. I found a Stack Overflow answer that says to link statically. I tried adding the following the build.rs, but it made no difference:

build.flag("-static-libstdc++");

No idea how to proceed, as I'm barely familiar with C++, Windows, or cross-compiling.

@grovesNL
Copy link
Owner

Hi @hannobraun! I think we could probably consider this a duplicate of #112

Were you able to work around this successfully? It looks like the linked issue was able to work around it by avoiding cross-compilation.

@hannobraun
Copy link
Author

Thanks for looking into this, @grovesNL! Indeed it looks like this is probably a duplicate of #112. I'm going to close.

And yes, this is no longer a problem for me downstream. I'm now compiling my binaries directly on Windows (using GitHub Actions), so cross-compiling is no longer required for me.

@grovesNL
Copy link
Owner

Ok great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants