As of release 0.12, Rust distribution for Windows is completely self-contained and includes all dependencies from MinGW toolchain required for building Windows binaries.
Notes:
- Rust compiler uses
gcc
as a linker driver, and will search for it in the systemPATH
before searching in the private directory. This means that any other versions found onPATH
will override the one bundled with Rust, and may cause linking errors if they aren't compatible. The solution is to strip down thePATH
in the console session used to launchrustc
. - The 32-bit binaries produced by
rustc
will depend on the shared GCC runtime library,libgcc_s_dw2-1.dll
, which you will need to distribute along with your program. You'll find it in the/bin
directory.
The 64-bit binaries are dependency-free.
If you want to use any dependencies that depend on C/C++ bits you will likely need a separately installed mingw as the mingw bundled with Rust is not capable of compiling C/C++ code, and only includes a minimal set of libs for system libraries. The recommended way to do this is using MSYS2.
- Download and install MSYS2 from http://msys2.github.io/.
- Download and install Rust+Cargo using the installer but be sure to disable the
Linker and platform libraries
option. - Ensure that Rust is in your
PATH
and that there are no mingw installations in yourPATH
. - Launch your MSYS2 environment using either
mingw32_shell.bat
ormingw64_shell.bat
depending upon which version of Rust you installed. - Install the mingw toolchain using
pacman -S mingw-w64-x86_64-toolchain
orpacman -S mingw-w64-i686-toolchain
depending upon which version of Rust you installed. - Install the base set of developer tools using
pacman -S base-devel
.
These instructions cover running Rust from a binary installation. To build Rust see [[further instructions|Note-getting-started-developing-Rust]].