deltaphc / raylib-rs

Rust bindings for raylib
Other
715 stars 123 forks source link

Windows .exe cannot run without some dependencies? #176

Open jxqu3 opened 7 months ago

jxqu3 commented 7 months ago

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?

kderef commented 7 months ago

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.