Install GCC in Git for Windows bash environment
Solution 1:
USE MINGW-W64
-
Install mingw-w64 (Follow the "Sourceforge" link) and install it to the default
Program Files
based path. -
Select the latest "version" (for GCC), change "architecture" from
i686
(32-bit) tox86_64
(64-bit), and change "threads" towin32
. -
Add the
bin
folder to the beginning of your Git BASH (MINGW64) path:$ export PATH="c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin:$PATH"
You'll, of course, need to adjust the above path to match the version of your of your particular install:
$ export PATH="c:/Program Files/mingw-w64/<YOUR_ARCH_VERSION_REVISION_FOLDER>/mingw64/bin:$PATH"
Alternatively
You may be able to just install it directly into the same folder as Git:
C:\Program Files\Git
.
But I haven't tried this alternative approach and I wouldn't recommend it because it is likely to cause issues when updating and may confuse uninstallers, leaving remnants. (if the two installations don't interfere to begin with)
[ Edit: GNU Make is installed as mingw32-make.exe
. You can make a copy of it, somewhere in your $PATH
which you have permission to, and rename it to make
. Git Bash seems to respect that it's executable, even without an extension, which is handy if you don't want it picked up outside of the MinGW environment (even though it may be in your PATH). ]
Solution 2:
FWIW I just uninstalled Git for Windows and instead installed both GCC and git within MSYS2, as @DanielB commented.
Solution 3:
You have to share Windows' PATH (and probably other) environment variables with MinGW. For MSYS2 you can share them by adding this to your Windows' env. variables:
MSYS2_PATH_TYPE=inherit