Install Rust on Windows — MSVC Toolchain Setup
Download rustup-init.exe, add the MSVC host toolchain, and configure Visual Studio Build Tools + Windows SDK for native builds.
Step-by-step (MSVC toolchain)
1) Download rustup-init.exe
Use the Direct download button above to get the official installer for x86_64-pc-windows-msvc.
2) Run the installer
Double-click the file and follow prompts. Choose the default MSVC host toolchain unless you need MinGW.
3) Install build tools
Install Visual Studio Build Tools (C++ workload) and the Windows 10/11 SDK if not present.
4) Restart terminal
Open a new Developer PowerShell/Command Prompt so updated PATH takes effect.
5) Verify toolchain
Run rustc --version and cargo --version. Create a test project: cargo new hello then cargo run.
6) Keep it updated
Update regularly with rustup update. Add components via rustup component add clippy rustfmt.
Verify your Windows build environment
- Open x64 Native Tools Command Prompt or Developer PowerShell.
- Check MSVC:
where cl.exe. Check SDKs in Visual Studio Installer → Individual components. - Compile a C dependency: try building a crate like
ringoropenssl-systo validate linker settings.
Common issues and quick fixes
- link.exe not found — Install Visual Studio Build Tools (C++ workload), restart terminal.
- windows.h / SDK headers missing — Add Windows 10/11 SDK via Visual Studio Installer.
- Architecture mismatch — Ensure you build x64 with the x64 Native Tools prompt and MSVC x64 components.
- PATH not updated — Open a fresh terminal after installing rustup and build tools.
What you get with MSVC
Best compatibility with Windows SDK, debuggers, and native desktop tooling. Recommended for most users.