2

I am using a up2date Linux Mint system which I am using for lots of trial and error projects. Today I stumbled upon Rust and wanted to try it out.

So far so good. Installing Rust was easy and simple.

Used the suggested method, set the environment-variable and performed a update:

  • curl https://sh.rustup.rs -sSf | sh
  • source $HOME/.cargo/env
  • rustup update

So far so good, no errors or other disturbing signals. So after the previous I tried, just like everybody does, compiling the 'Hello world'-example. And here it went sideways. The error:

...
$ rustc main.rs
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" [....... ]"-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
          /usr/bin/ld: cannot find crti.o: No such file or directory
          collect2: error: ld returned 1 exit status
...

My system has cc installed: cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Does anyone have any idea how I can fix this?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
sgoeting
  • 57
  • 5
  • 1
    Welcome to SO! Please, if you have a problem, try to find out if somebody else had a smiliar problem and if there was a useful answer. Maybe this solves your problem: https://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o or https://stackoverflow.com/questions/3299511/missing-crt1-and-crti-when-crosscompiling. Check https://stackoverflow.com/questions/16436035/whats-the-usage-of-mcrt1-o-and-scrt1-o for details. – Twonky Feb 01 '20 at 14:29
  • 2
    Duplicate of [Compiling problems: cannot find crt1.o](https://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o) – Herohtar Feb 01 '20 at 22:39

1 Answers1

2

I found an answer that's working for me in other post for Clang: Compiling problems: cannot find crt1.o.

Answer given by Dmitry Pavlenko works just fine for me too:

The problem is you likely only have the gcc for your current architecture and that's 64bit. You need the 32bit support files. For that, you need to install

sudo apt install gcc-multilib

sgoeting
  • 57
  • 5