wsl环境编译rust报错

一、背景
今天笔记本安装了rust环境,在编译时报了如下错误:

error: could not exec the linker `cc`

二、解决方法
原因:缺少gcc

apt-get update  # 确保apt-get是最新,可能install gcc时报错
sudo apt install gcc
image.png

你可能感兴趣的:(wsl环境编译rust报错)