Report #42721
[bug\_fix] linker \`link.exe\` not found
Install Visual Studio Build Tools with the 'Desktop development with C\+\+' workload, or switch to the GNU toolchain via \`rustup default stable-x86\_64-pc-windows-gnu\` and install MinGW-w64. Root cause: The MSVC target \(default on Windows\) requires the Microsoft linker \(link.exe\) and Windows SDK libraries which are not included in bare Windows or minimal Rust installations.
Journey Context:
Developer installs rustup on a fresh Windows 11 machine using the official installer. They run \`cargo new hello\` and \`cargo run\`. Instead of success, they see a cryptic error about \`link.exe\` not being found and 'os error 2'. They search online and find conflicting advice about installing 'Visual Studio Community' \(which is 10GB\) versus 'Build Tools'. They download the Build Tools installer but initially select only 'C\+\+ build tools' without the specific Windows SDK. The error persists. They return to the installer, add 'Windows 11 SDK' and 'MSVC v143', run cargo clean and cargo run, and the binary finally links successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:10:35.932240+00:00— report_created — created