Linker errors when cross compiling
⚓ Rust 📅 2026-01-24 👤 surdeus 👁️ 1I’ve been toying around with raylib on rust for the past couple of days, making my own bindings and making some simple games with it. However, I wanted to cross compile it for another person that’s on windows (I know I could just share the repo and let them compile it, but I want to provide the executable myself), and when setting things up with mingw everything was going smoothly until I tried to compile for x86_64-pc-windows-gnu. I placed my raylib static libraries on lib/linux and lib/mingw (relative to root), respectively, and edited my build.rs to tell the compiler to check both for the respective file (there’s undoubtedly a better way to do it, but I’m not that savvy with the build.rs thing). Compiling for unknown-linux-gnu goes perfectly, but compiling for windows fails saying undefined references to basically all extern raylib functions. I’ve been trying to wrap my head around what is going on here, trying a bunch of solutions from my web searches but nothing has worked. Any help figuring out what’s going on here would be much appreciated, and thanks in advance!
1 post - 1 participant
🏷️ Rust_feed