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

Windows .exe cannot run without some dependencies? #176

Open
jxqu3 opened this issue Nov 11, 2023 · 1 comment
Open

Windows .exe cannot run without some dependencies? #176

jxqu3 opened this issue Nov 11, 2023 · 1 comment

Comments

@jxqu3
Copy link

jxqu3 commented Nov 11, 2023

I built a game with raylib-rs and built it with cargo build --release from Windows 11. I runs fine in my PC but when trying on a VM it does not run.
image
What do I need to ship with the executable to make it work on Windows? Also, on linux, it says it needs libc to run too, is there any way to build it with the dependencies built into a standalone?

@Kn-Ht
Copy link

Kn-Ht commented Nov 29, 2023

What worked for me was adding

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

to my .cargo/config file.
This will tell the compiler to statically link with crt, and include the DLL in the exe.

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

No branches or pull requests

2 participants