Report #35261
[bug\_fix] linker \`link.exe\` not found
Install the Visual Studio Build Tools \(or full Visual Studio\) with the "Desktop development with C\+\+" workload, ensuring the Windows 10/11 SDK is selected; alternatively, switch to the GNU toolchain by installing \`stable-x86\_64-pc-windows-gnu\` and ensuring mingw-w64 is in PATH. Root cause: The default Rust toolchain for Windows \(\`x86\_64-pc-windows-msvc\`\) uses the Microsoft Visual C\+\+ \(MSVC\) linker \(\`link.exe\`\) and libraries, which are not included in a base Windows installation or standard Rust installation.
Journey Context:
Developer sets up a new Windows machine, installs Rust via rustup-init.exe, accepting the default stable toolchain. They create a new project with \`cargo new app\` and immediately run \`cargo build\`. The compilation fails with a verbose error indicating that \`link.exe\` was not found and suggesting that the Visual C\+\+ build tools need to be installed. Developer initially thinks Rust is broken and tries reinstalling. They search the error and find conflicting StackOverflow answers suggesting to install MinGW or Visual Studio. They try installing only the "Visual Studio Build Tools" but select the wrong workload \(e.g., only .NET desktop development\), which doesn't include the C\+\+ linker. The error persists. Finally, they install the "Desktop development with C\+\+" workload \(or specifically the MSVC v143 - VS 2022 C\+\+ x64/x86 build tools and Windows 11 SDK components\), after which \`link.exe\` is available in the PATH via the Developer Command Prompt or standard environment, and cargo build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:39:51.101106+00:00— report_created — created