1
0

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 3 years have passed since last update.

rustと動かないWSL

Last updated at Posted at 2021-08-15

WSLでubuntu20.04

プログラミング言語入門通りにやっていたら
WSLのインストール→できた
rustインストール→できた
helloworldファイル作成→できた
起動→ビルドできない
buildコマンドでもrustcコマンドでもできない

linker cc not found
がでてきている。公式の
https://users.rust-lang.org/t/ghostbsd-freebsd-error-linker-cc-not-found/43928
とか見ると
cコンパイラがなさそう
gcc--version してみたらやっぱりないっぽい
というわけで
$ sudo apt install build-essential
してみる
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/gcc-10/libquadmath0_10.2.0-5ubuntu1~20.04_amd64.deb 404 Not Found [IP: 2001:67c:1360:8001::23 80]
みたいなえらーがいっぱい出てきた
パッケージリストが悪さをしているらしい
https://qiita.com/miriwo/items/bc2c0f18ee7d6f337ed0
$ sudo rm -rf /var/lib/apt/lists/*
したあとに再度
$ sudo apt install build-essential
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package build-essential

ってなってしまった。とりあえず
$ sudo apt-get update
$ sudo apt install build-essential
してみる→無事gcc入った
$cargo run で無事helloworldできました

追記
モジュールのインポートができない。原因不明

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?