Compilation failure

$ cargo build
Compiling hello v0.1.0 (~/dev/rust/hello)
error: linking with cc failed: exit status: 1
= note: gcc: error: unrecognized command line option '-m64.c'; did you mean '-m64'?
gcc: fatal error: no input files
compilation terminated.

Does anyone know why this is happening?
I did search the internet looking for answers but no luck so far.
I am using Ubuntu 20.04.4.

Update: I also have Fedora 35 and there I have no problems.
Compiling hello v0.1.0 (~/dev/rust/hello)
Finished dev [unoptimized + debuginfo] target(s) in 0.74s

Is it an Ubuntu issue?

On Fedora 35, I get no problems
Compiling hello v0.1.0 (~/dev/rust/hello)
Finished dev [unoptimized + debuginfo] target(s) in 0.74s

I've never had any issues with stock Ubuntu 20.04. What output do you get from running cargo build -v, rustc -V -v, and file -L $(command -v cc) ?

1 Like

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.