やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

chocolateyでMinGWを入手する

前回のつづき。chocolateyからMinGWをインストールする。

choco.exe install gcc gcc-g++

g++のインストールを試してみるも失敗。

>choco.exe install gcc gcc-g++
Chocolatey v0.10.0
Installing the following packages:
gcc;gcc-g++
By installing you accept licenses for the packages.
gcc not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"
gcc-g++ not installed. The package was not found with the source(s) listed.
 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"

Chocolatey installed 0/2 packages. 2 packages failed.
 See the log for details (C:\Documents and Settings\All Users\Application Data\c
hocolatey\logs\chocolatey.log).

Failures
 - gcc-g++ - gcc-g++ not installed. The package was not found with the source(s)
 listed.
 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"
 - gcc - gcc not installed. The package was not found with the source(s) listed.

 If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
 Version: ""
 Source(s): "https://chocolatey.org/api/v2/"

Check out Pro / Business for more features! https://chocolatey.org/compare

choco install mingw

成功!

途中でyを入力しEnterキー押下して進める。

>choco install mingw
Chocolatey v0.10.0
Installing the following packages:
mingw
By installing you accept licenses for the packages.

mingw v5.3.0 [Approved]
The package mingw wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider setting
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
Do you want to run the script?([Y]es/[N]o/[P]rint): y

Get-BinRoot is going to be deprecated in v1 and removed in v2. It is being repla
ced with Get-ToolsLocation, however many packages no longer require a special se
parate directory since package folders no longer have versions on them. Some do
though and should continue to use Get-ToolsLocation.
WARNING: Failure attempting to let Explorer know about updated environment setti
ngs.
  The term 'C:\WINDOWS\System32\setx.exe' is not recognized as the name of a cmd
let, function, script file, or operable program. Check the spelling of the name,
 or if a path was included, verify that the path is correct and try again.
Downloading mingw
  from 'http://downloads.sourceforge.net/mingw-w64/i686-5.3.0-release-posix-sjlj
-rt_v4-rev0.7z'
Progress: 100% - Completed download of C:\Documents and Settings\Administrator\L
ocal Settings\Temp\mingw\5.3.0\i686-5.3.0-release-posix-sjlj-rt_v4-rev0.7z (44.5
5 MB).
Download of i686-5.3.0-release-posix-sjlj-rt_v4-rev0.7z (44.55 MB) completed.
Hashes match.
Extracting C:\Documents and Settings\Administrator\Local Settings\Temp\mingw\5.3
.0\i686-5.3.0-release-posix-sjlj-rt_v4-rev0.7z to C:\tools...
C:\tools
Adding 'C:\tools\mingw32' to the path and the current shell path
PATH environment variable does not have C:\tools\mingw32\bin in it. Adding...
WARNING: Failure attempting to let Explorer know about updated environment setti
ngs.
  The term 'C:\WINDOWS\System32\setx.exe' is not recognized as the name of a cmd
let, function, script file, or operable program. Check the spelling of the name,
 or if a path was included, verify that the path is correct and try again.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of mingw was successful.
  Software installed to 'C:\tools'
mingw not installed. An error occurred during installation:
 Path to combine cannot be empty.
The install of mingw was NOT successful.
mingw not installed. An error occurred during installation:
 Path to combine cannot be empty.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\Documents and Settings\All Users\Application Data\c
hocolatey\logs\chocolatey.log).

Failures
 - mingw (exited 1) - mingw not installed. An error occurred during installation
:
 Path to combine cannot be empty.

v5.3.0だった。 C:\toolsmingw32ディレクトリが生成されていた。 C:\tools\mingw32\binディレクトリにg++.exeが存在していた。

g++

C:\tools\mingw32\bin>g++ --version
g++ (i686-posix-sjlj-rev0, Built by MinGW-W64 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

msys-baseがない

こちらによると必要なコンポーネントは以下の通り。

  • mingw32-base
  • mingw32-gcc-g++
  • msys-base

今回はmsysがないのでは?

少なくともC:\tools\mingw32\ディレクトリ配下に"msys"ディレクトリはない。

次回はmsysをインストールしてみる。