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できました
追記
モジュールのインポートができない。原因不明