Rust errors / Build and Cargo
Rust build error · checked with Rust 1.99.0
error: linker `cc` not found
error: linker `cc` not found
What it meansOn Linux and macOS Rust uses the system C compiler (cc) as its linker, and none is installed.
Why it happens
- A fresh Linux install or slim Docker image without build tools.
- macOS without the Xcode command line tools.
How to fix it
1. Debian or Ubuntu
sudo apt update && sudo apt install build-essential2. Fedora
sudo dnf install gcc3. Alpine (musl)
apk add build-base4. macOS
xcode-select --installOther wordings of this error
linker cc not found, error: linker `cc` not found rust ubuntu, linker gcc not found
Other build errors
- error: linker `link.exe` not found
- error: failed to run custom build command for `openssl-sys`
- error: failed to select a version for the requirement
- error: failed to select a version for `libsqlite3-sys`... the package `libsqlite3-sys` lin
- error: could not compile `my-crate` (bin "my-crate") due to 1 previous error
- error: package `foo v1.2.3` cannot be built because it requires rustc 1.80 or newer, while
- feature `edition2024` is required
- Blocking waiting for file lock on package cache
Up next
Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →Also worth your time
Did this answer your question?