LoginSignup
10
3

More than 5 years have passed since last update.

Rustのhelloworldのコンパイルでつまづいた

Posted at

Rust: 2nd Editionの日本語版PDFのhelloworldをやってみたときにコンパイルの部分でエラーが出たのでメモ。

error: linker `link.exe` not found
  |
  = note: 指定されたファイルが見つかりません。 (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013 or VS 2015 was installed with the Visual C++ option
error: aborting due to previous error

資料をよく見たらちゃんと書いていたが、VisualStudio2017用のビルドツールが必要だった。

VisualStudio2017用のビルドツールの説明

これらの Build Tools を使用すると、Visual Studio IDE を必要とせずに、MSBuild ベースのネイティブおよびマネージ アプリケーションをビルドできます。 Visual C++ コンパイラやライブラリ、MFC、ATL、C++/CLI サポートをインストールするオプションもあります。

ビルドツールを入れるためには下記のようにする。

資料の赤枠のところがリンクできるようになっているので、そこを押すとVisualStudioなどの
ダウンロード画面に遷移する。

b_1.png

遷移後の画面の下部に以下のダウンロード項目があるので、これを選択する。
b_2.png

Visual C++ Build Toolsを選択してインストールすればコンパイルが通るようになる。
b_3.png

参考

10
3
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
10
3