Report #62575
[bug\_fix] ld: library not found for -lSystem
Install Xcode Command Line Tools by running \`xcode-select --install\` in Terminal, or if already installed but paths are wrong, reset with \`sudo xcode-select --reset\`.
Journey Context:
Developer installs Rust via rustup on a fresh macOS machine. They create a new project with \`cargo new hello\` and immediately run \`cargo run\`. The compilation proceeds through rustc but fails at the linker stage with \`ld: library not found for -lSystem\` or similar errors about missing crt1.o. Developer searches online and finds that the Rust compiler relies on the system linker and C runtime libraries provided by Apple's Xcode toolchain. They open Terminal and run \`xcode-select --install\`, which opens a GUI dialog to install the Command Line Tools. After installation completes, they retry \`cargo build\` and the linking succeeds. In some cases, if tools were installed but the SDK path changed after an OS update, the fix requires \`sudo xcode-select --reset\` to point to the correct active developer directory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:31:05.254933+00:00— report_created — created