cargolinux95% confidence\u2191 325

How do I fix the Rust error "linker 'cc' not found" for Debian on Windows 10?

Full error message
I'm running Debian on Windows 10 (Windows Subsystem for Linux) and installed Rust using the command:

curl https://sh.rustup.rs -sSf | sh

There were no errors in the install, but when I tried to compile with rustc I got the error linker 'cc' not found.

The Linux Rust installer doesn't check for a compiler toolchain, but seems to assume that you've already got a C linker installed! The best solution is to install the tried-and-true gcc toolchain. sudo apt install build-essential If you need to target another architecture, install the appropriate toolchain and target the compilation as follows: rustc --target=my_target_architecture -C linker=target_toolchain_linker my_rustfile.rs

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/b9642a98fab9ec1b4cb173e5775432d46548dff977191c9bee5c908b432d9332
hash \u00b7 b9642a98fab9ec1b4cb173e5775432d46548dff977191c9bee5c908b432d9332
How do I fix the Rust error "linker 'cc' not fo… — DepScope fix | DepScope