Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save emeraldinspirations/3c6cb901af48bcae6f69a1e06950a313 to your computer and use it in GitHub Desktop.

Select an option

Save emeraldinspirations/3c6cb901af48bcae6f69a1e06950a313 to your computer and use it in GitHub Desktop.

Cross-compiling from Ubuntu to Windows with Rustup

Source: https://www.reddit.com/r/rust/comments/5k8uab/crosscompiling_from_ubuntu_to_windows_with_rustup/dbmx0ub?utm_source=share&utm_medium=web2x

Thanks to /u/ssokolow and /u/mmstick for a solution!

I did:

sudo apt install mingw-w64

I had to create ~/.cargo/config/ and write:

[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
ar = "x86_64-w64-mingw32-gcc-ar"

Then I just did:

cargo build --release --target=x86_64-pc-windows-gnu --verbose

Thanks again, everyone, for all of your help!

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