Basically I\'m trying to compile the simplest code to Windows while I am developing on Linux.
fn main() {
println!(\"Hello, and bye.\")
}
There is Docker based solution called cross. All the required tools are in virtualized environment so you don't need to install additional packages for your machine. See Supported targets list.
From project's README:
cross will provide all the ingredients needed for cross compilation without touching your system installation.cross provides an environment, cross toolchain and cross compiled libraries, that produces the most portable binaries.cross can test crates for architectures other than i686 and x86_64.rustupbinfmt_misc support is required for cross testing.One of these container engines is required. If both are installed, cross will default to docker.
docker group. Read the official post-installation steps. Requires version 1.24 or later.$ cargo install cross
cross has the exact same CLI as Cargo but as it relies on Docker you'll have to start the daemon before you can use it.
# (ONCE PER BOOT)
# Start the Docker daemon, if it's not already running
$ sudo systemctl start docker
# MAGIC! This Just Works
$ cross build --target aarch64-unknown-linux-gnu
# EVEN MORE MAGICAL! This also Just Works
$ cross test --target mips64-unknown-linux-gnuabi64
# Obviously, this also Just Works
$ cross rustc --target powerpc-unknown-linux-gnu --release -- -C lto