0
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 1 year has passed since last update.

RustでCargo.tomlを導入したらlinker `cc` not foundエラーがでる

Posted at

はじめに

この度転職で利用するであろうRustの学習を始めることにしました
Rustは最高難易度の言語と呼ばれているほど難しいのを知っていたので、初心者がつまづきそうな問題をどんどん記事にしていきます

今回はWebサーバーでHello Worldしようとしたときにつまづいたものです

問題

Cargo.tomlを導入してcargo runをしたところ以下のエラーがでました

linking with `cc` failed: exit status: 1

以降入れたライブラリがcompile後にエラーになる

書籍通りにやっているのになぜか動きませんでした

解決方法

これはコンパイラが環境になかったことで起きていました

私の場合はDockerのAlpine環境で動かしていたので以下を追加することでうまく行きました

Dockefile
RUN apt install alpine-sdk

これはbuild-essentialの代わりとなります

おわりに

はじめて触る言語はある程度全体的に学ぶまでは問題がおきるととても不安になります

参考

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