Rust 관련 오류 모음

1. linker ‘cc’ not found

오류 발생 과정

노트북을 초기화하고 WSL에 Rust를 설치한 다음 cargo new로 생성한 프로젝트를 실행할 때 발생한 오류.

원인

WSL에 C 컴파일러가 설치되어 있지 않음.

해결

$ sudo apt install build-essential cmake

2. The pkg-config command could not be found.

원인

WSL에 pkg-config가 설치되어 있지 않음.

해결

$ sudo apt install pkg-config

2. pkg-config exited with status code 1

원인

The system library `openssl` required by crate `openssl-sys` was not found.

해결

$ sudo apt install libssl-dev