Report #93032
[bug\_fix] error: linker \`link.exe\` not found
Install the Microsoft C\+\+ Build Tools with the 'Desktop development with C\+\+' workload, or switch to the GNU toolchain by running \`rustup default stable-x86\_64-pc-windows-gnu\`.
Journey Context:
Developer installs Rust on a fresh Windows machine using \`rustup-init.exe\` and accepts the default installation. They create a new project with \`cargo new\` and run \`cargo build\`. The compilation fails at the linking stage with an error indicating that \`link.exe\` cannot be found. Developer searches the error and discovers that the MSVC \(Microsoft Visual C\+\+\) toolchain requires the Visual Studio linker, which is not installed by default on Windows. They initially try to install just the standalone Windows SDK or older Visual C\+\+ redistributables, which do not provide the necessary build tools. After reading the Rustup documentation, they understand that there are two valid paths: either install the full Microsoft C\+\+ Build Tools \(which includes the required linker and libraries\), or switch Rust to use the GNU toolchain which relies on GCC \(requiring MinGW\). The developer chooses to install the Build Tools to remain on the standard MSVC path, resolves the environment variables, and successfully compiles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:44:32.053920+00:00— report_created — created