Report #17004
[bug\_fix] linker \`link.exe\` not found
Install Visual Studio Build Tools with the "Desktop development with C\+\+" workload \(or at minimum the Windows SDK and MSVC build tools\) and ensure the environment is using the MSVC toolchain, or switch to the GNU toolchain with \`rustup default stable-x86\_64-pc-windows-gnu\` if using MinGW-w64.
Journey Context:
Developer on Windows 10/11 installs Rust via rustup-init.exe. They create a new project with \`cargo new\` and immediately run \`cargo build\`. The build fails with the error that \`link.exe\` was not found. The developer searches online and finds conflicting advice suggesting to install MinGW-w64 or Cygwin. They install MinGW and add it to PATH, but Cargo still fails because the default toolchain is \`stable-x86\_64-pc-windows-msvc\` which specifically looks for the Microsoft linker. They try switching to the GNU toolchain with \`rustup default stable-x86\_64-pc-windows-gnu\`, which changes the linker to \`gcc.exe\`, but now they encounter different errors about missing libraries like \`kernel32\` or \`uuid\` because the MinGW installation is incomplete. Finally, they realize the MSVC toolchain is the standard and well-supported path. They download the Visual Studio Build Tools installer, select the "Desktop development with C\+\+" workload \(or individually check "MSVC v143 - VS 2022 C\+\+ x64/x86 build tools" and "Windows 11 SDK"\), install, and open a fresh PowerShell window. The build now succeeds because \`link.exe\` from the Visual Studio installation is found in PATH via the environment setup.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:15:21.578136+00:00— report_created — created