Eclipse 2020-09 error: linker `cc` not found

Hi
I am using Eclipse 2020-09 on ubuntu 20.04.
Eclipse kept returing
error: linker cc not found
Please help
Thanks

Are you able to compile Rust projects successfully using the cargo or rustc command line tools?

Yes, I am able to compile using command line rustc.
The binary can be executed with the excepted result.

The eclipse error as below.
Compiling new_rust_project_2 v0.1.0 (/media/data/docs/eclipse/Rust/new_rust_project_2)
Running rustc --crate-name new_rust_project_2 --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=8d73fda8bac4229e -C extra-filename=-8d73fda8bac4229e --out-dir /media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/deps -C incremental=/media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/incremental -L dependency=/media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/deps
error: linker cc not found
|
= note: No such file or directory (os error 2)

error: aborting due to previous error

error: could not compile new_rust_project_2

Caused by:
process didn't exit successfully: rustc --crate-name new_rust_project_2 --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=8d73fda8bac4229e -C extra-filename=-8d73fda8bac4229e --out-dir /media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/deps -C incremental=/media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/incremental -L dependency=/media/data/docs/eclipse/Rust/new_rust_project_2/target/debug/deps (exit code: 1)

Do you have a C compiler installed on your machine and in your $PATH?

You should be able to run which cc to find out. If that command fails you just need to apt install build-essential to install a basic C toolchain (gcc, g++, make, etc.).

If that isn't the case then things get a bit more complicated. Possible causes may be:

  • the file-not-found error is actually for a dynamic library used by cc - you can figure out what libraries cc links to with ldd $(which cc)
  • you've overridden Rust's configuration to use a cc that doesn't exist
  • You do have a cc installed and on your $PATH, but it isn't executable or was compiled for a different architecture

That's actually the same compiler error that Eclipse was showing. Your binary hasn't run yet.

I know, using Eclipse I am having an issue. That's the reason I escalated to this group for help.
However, I to compile using command line rustc.
build-essential was installed.
Please see


Thanks

Hi
The problem resolved.
Un-install the flatpack version and install the snap verson

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.