How to Install mingw-w64 Compiler for C,C++ in Windows, Linux & MacOs?

Mingw-w64

Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution.
For Windows:-
  • Download Mingw-w64 setup for windows from here - Download
  • Select the installation directory (Leave it as it is Recommended )
  • Click on continue
  • Now the download of the package start
  • After downloading of the package completed
  • Click on continue, then it will start the Mingw installation manager
  • Now select all the packages for installation
  • After selecting all the packages go to left top corner, click on Installation & apply changes
  • Now it will ask "Ok to proceed?" click apply
  • It will take some time depending on your Internet speed
  • After all packages gets installed , click close
  • Now go to the folder where u installed Mingw (check step 2 installation directory) for my case Mingw is installed in 

C:\\Mingw\

  •  Now go to "bin" directory in Mingw Folder
  • Copy the location of the directory up to bin
  • Now, Press "windows key + s " or simply search "Environment variables"
  • Then result will show up
     
  • Open "Edit the system environment variables"

  • Then open Environment Variables
                                 
  • Then choose the "Path Enviroment variable" in system variable
  • Click on Edit then New
  • Then add the location of the directory where Mingw is installed
  • Click ok & Close all the window
  • Now next step is to check if Mingw is working or not for that open "cmd" by simply pressing "windows key + R" it will open Run then type "cmd" there then hit ok


  • It will open command prompt (cmd)
  • Then type
gcc --version   


  • It will show the installed Mingw version
  • If it throws error 

'gcc' is not recognized as internal or external command

  • Then u must have missed any step check the path variable location again. 

0 Comments