Rust for Windows
Unofficial guide • Native Windows tooling

Fix Build Errors on Windows — Rust Troubleshooting

Solve missing linkers, SDK headers, unresolved symbols and architecture mismatches when building Rust apps on Windows.

Installation guide Release checklist
File: rustup-init.exe • Source: rust-lang.org • Last updated: —

Most frequent errors and fixes

link.exe not found

Install Visual Studio Build Tools (C++ workload). Open a fresh x64 Developer shell so PATH includes MSVC.

Missing Windows SDK headers/libs

Add Windows 10/11 SDK via Visual Studio Installer → Individual components. Reopen terminal.

LNK1104 / unresolved external symbol

Match architecture (x64), ensure SDK libs installed, and verify any C deps (vcpkg/CMake) are configured.

Wrong target triple

Use the MSVC host: x86_64-pc-windows-msvc. Switch if needed and rebuild in an x64 shell.

OpenSSL / native deps fail

Install build tools and SDK, then use vcpkg or prebuilt binaries. Ensure environment vars point to the right libs.

CMake not found

Install CMake (User or System) and reopen terminal so it’s on PATH. Some crates run CMake in build.rs.

Toolchain sanity check

Switch to the MSVC host

If you installed the GNU toolchain by accident, switch to MSVC for best Windows compatibility.

Clean reinstall (last resort)

  1. Uninstall rustup toolchains if corrupted.
  2. Reinstall Visual Studio Build Tools + Windows SDK.
  3. Re-run rustup-init.exe and accept defaults for MSVC.
  4. Open a fresh terminal and rebuild a sample project.

Next steps