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

`link.exe not found`が発生した場合の対応

Last updated at Posted at 2025-10-31

問題

Windows環境で、rustupを利用し、RustとVisual Studioをインストールした後、cargo installを実行すると、以下のエラーが発生しました。

error: linker `link.exe` not found
  |
  = note: program not found

原因

このエラーは、RustがWindows向けのバイナリをビルドする際に必要な「リンカ(link.exe)」が見つからない場合に発生します。

Visual Studio自体はインストールされていても、「C++によるデスクトップ開発」ワークロードが追加されていない場合、link.exeが含まれていません。そのため、Rustのビルド時にlink.exeが検出できずエラーとなります。

対応

Rustのインストール時にVisual Studioも一緒に導入している場合でも、必要なワークロードが入っていないことがあります。以下の手順で link.exe をインストールしてください。

1. Visual Studio Installerの起動

スタートメニューから「Visual Studio Installer」を起動します。

image.png

2. インストール済みのVisual Studioの変更

インストールされているVisual Studioの「変更」を選択します。

image.png

3. 「C++によるデスクトップ開発」を追加

「ワークロード」タブで「C++によるデスクトップ開発」にチェックを入れ、「変更」をクリックしてインストールを開始します。

c32ebbba-f0c4-430e-9451-fb52a2bbb97f.png

インストールが完了したら、cargo installコマンドを再度実行してください。

環境情報

  • Microsoft Windows [Version 10.0.17763.4131]
  • Rust
    • rustc 1.89.0 (29483883e 2025-08-04)
    • cargo 1.89.0 (c24e10642 2025-06-23)
    • rustup 1.28.2 (e4f3ad6f8 2025-04-28)
  • Visual Studio 2022
1
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
1
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?