Mingw is not installing

·

2 min read

Mingw is a compiler for C++ in Windows. During the installation, you may face several issues related to installation. One of the reasons could be your network.

Alternative to mingw

You can use msys2 for the installation of the compiler.

Benefits of msys2

  • It has all the compilers available for C++.

  • It has all the versions available for the compiler.

  • Updating the compiler is easy.

Installation steps:

(*) Go to the installation section and download.

  • Leave everything as default and click on Next.

  • Install it as you would install other software.

After installation of msys2

  • Open msys2 from the Start menu.

  • Type the following command

pacman -Syu
  • If prompted, type y

  • Type the following command

pacman -Su
  • If prompted, type y

  • Type the following command to install gcc

pacman -S mingw-w64-x86_64-gcc
  • If prompted, type y

  • For the installation of gdb, type the following command

pacman -S mingw-w64-x86_64-gdb
  • If prompted, type y

Till now, your installation is done. It’s time to set the environment variable.

Set environment variable

  • Open the Start menu and search for environment variable. Click on this

  • Click on Environment Variables option

  • Double-click on Path in User variables.

    • Click on New and paste "C:\msys64\mingw64\bin" (Verify the path exists on your computer. If not, go to the msys64 folder, then mingw64, copy the bin folder path, and paste it.)

    • Click OK, then OK again, and once more OK.

Verify the installation

  • Open the terminal and type c++ --version.

  • If the output is like this, the installation is correct. If not, try to follow the steps as described.

You are all set to use the C++ compiler.