1
2

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.

WindowsにMinGWをインストールする(Scoopで)

Posted at

WindowsにC言語の開発環境を整えようと思い、
MinGWをMinGW-w64からダウンロード&インストールしようとしました。

しかし問題が発生。

インストール中に"The file has been downloaded incorrectly!"と表示される

image.png

これです。

ググったところ他にも同じところで詰まっている方が結構居ました。

開発者権限で実行するとか、再度ダウンロードするとか、一般的な対応方法ではうまくいかないようです。(私もダメでした。)

公式からのダウンロード&インストールを諦めて、Scoopを使ったところうまくいきました。

ScoopでMinGWを入れる

Scoopとは

A command-line installer for Windows

です。aptとかhome-brewだ、と思えばいいです。

インストールがまだの方は以下記事参照してインストールしてください。

参考:Windows用コマンドラインインストーラのScoopを使う - Qiita

インストールが済んだら、Scoopを使って入れたいもの、を先の公式ページから検索してみます。

image.png

MinGWもちゃんとScoopにありましたので、書いてあるコマンド

scoop install mingw

を実行。

PS C:\Users\yoshiki.ito> scoop install mingw
Installing 'mingw' (8.1.0) [64bit]
x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z (47.1 MB) [==========================================================] 100%
Checking hash of x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z ... ok.
Extracting x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z ... done.
Linking ~\scoop\apps\mingw\current => ~\scoop\apps\mingw\8.1.0
Running post_install script...
'mingw' (8.1.0) was installed successfully!
Notes
-----
- You are installing the Mingw-w64 implementation of GCC.
This implementation has a better compatibility, but may not support newer C/C++ standards.
For more recent GCC versions, try 'mingw-winlibs' or 'mingw-nuwen'.

インストールが無事完了しました。

Scoopから入れておけば管理も楽ですし、違うやり方がどうしてもうまくいかない、という場合はScoop使うのはアリです。

念のためgcc --helpでインストールできていることを確認

PS C:\Users\yoshiki.ito> gcc --help
Usage: gcc.exe [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase.
  --help                   Display this information.
  --target-help            Display target specific command line options.
  --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
                           Display specific types of command line options.
  (Use '-v --help' to display command line options of sub-processes).
※以下略

問題なさそうです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?