3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

「error linker `cc` not found」解決

Last updated at Posted at 2023-10-24

Rustのコンパイルエラー対応

公式サイト

error: linker cc not found

Cのコンパイラがインストールされていない場合、下記エラーが表示される。

/workspaces/rust_devcontainer (master) $ 
error: linker `cc` not found
|
= note: No such file or directory (os error 2)

error: aborting due to previous error

/workspaces/rust_devcontainer (master) $ 

Ubuntuの場合

build-essentialをインストールする。

sudo apt install -y build-essential

インストール後、再度コンパイルすることで問題なく実行できる。

vscode ➜ /workspaces/rust_devcontainer (master) $ 
vscode ➜ /workspaces/rust_devcontainer (master) $ ./main
Hello World!

参考URL
https://omohikane.com/rust_cargo_build_linker_cc_not_found/

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?