Rust 実行時にエラー「error: linker cc not found」発生する原因と解決法

  • 作成日 2021.05.19
  • 更新日 2022.12.12
  • Rust
Rust 実行時にエラー「error: linker cc not found」発生する原因と解決法

Rust 実行時にエラー「error: linker cc not found」が発生する原因と解決手順を記述してます。

環境

  • OS Ubuntu20.10
  • rustc 1.47.0

エラー全文

実行時に発生

rustc hoge.rs

<出力結果>
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

原因

gccがインストールされていないだけ

解決法

gccをインストールする

sudo apt install -y gcc