After installing First time rust on ubuntu try to run this program.
fn main() {
println!("Hello, world!");
}
Error:
$ cargo run
Compiling test1 v0.1.0 (/home/saad/Documents/Rust/test1)
error: linker `cc` not found
|
= note: No such file or directory (os error 2)
error: aborting due to previous error
error: could not compile `test1`.
As mentioned in the message, the linker 'cc' is missing.
You can install it using apt-get
:
sudo apt-get install gcc
After the installation completes, the problem should be solved.
Your system is missing a C linker, which Rustup assumes that you already have. You can install one (among other potentially useful tools, like make) via the following command:
sudo apt install build-essential
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With