For programmers used to developing on Linux, Windows is an incredibly unfriendly programming environment. What is the best way to create a Linux programmer friendly developer environment on Windows?
In the past, the best way to create a Unix like development environment on Windows was by installing cygwin. Unfortunately, cygwin is not Windows, and software developed in it requires the cygwin DLLs to be installed on the target machine. This led to the development of MinGW (minimal GNU for Windows), a package of GNU utilities that can run natively on Windows, along with a port of the GNU bash shell.
Microsoft has release their own shell, the PowerShell. It has some attractive features, but is completely different from bash. While looking for a solution to provide git in PowerShell, I came across Git for Windows, which offers git bash, a Windows command tool that runs the MinGW bash shell. This seems to be a better solution than PowerShell if you are coming from a Linux development background.
The following document describes how to add new utilities to git bash: How to add more to Git Bash on Windows. I intend to try to use git bash as my development environment on Windows, and will try to update this post and make new posts describing what I’m doing and how it works out.
First thing I need is a C compiler. The MinGW 64 installer can be found (and downloaded from) here: https://sourceforge.net/projects/mingw-w64/. It is straightforward to install. Before it will be usable from Git Bash, you need to add it to the path:
- Open the Control Panel. If your using Classic Shell, click Start and select Programs/Windows System/Control Panel
- Click System and Security
- Click on Environment Variables.
- Double Click on System variables > Path
C:\Program Files (x86)\mingw-64\i686-7.3.0-posix-dwarf-rt_v5-rev0\mingw32\binto the Variable value
Open a new git bash shell. You should be able to run: gcc –version