Avatar ·

Error "linker 'cc' not found" when compiling Rust on Debian in WSL on Windows 10

Hello, colleagues! I'm new to Rust and using Windows 10 with WSL (Debian) installed. When I try to compile a simple program, I get an error. Here's my code (main.rs file): ```rust fn main() { println!("Hello, world!"); } ``` I run `rustc main.rs` or `cargo build` in the WSL (Debian) terminal, and I get the message: ``` error: linker `cc` not found | = note: No such file or directory (os error 2) ``` Rust was installed via `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`, everything went successfully. The `rustc --version` command shows 1.70.0. But the compiler cannot find the linker. I've already googled it, but most advice is for pure Linux, not for WSL. I tried `sudo apt update && sudo apt install build-essential` — it didn't help. Maybe