How to Install the MinGW Tools for C/C++ (2024)

Rose-Hulman Institute of Technology –
Computer Science & Software Engineering

Overview

Follow these directions to the MinGW tools for developing code in C/C++. ( All RHIT laptops came with MinGW installed)

Install the MinGW Tools for C/C++

  1. Log in to your regular user account.
  2. Download thisMinGW folder and run it. Your browser may warn that "This file is not commonly downloaded and may harm your computer" , but run it anyway. (In one dialog box, selecting 'additional options' allowed it to run. This installation will download various files from the web.
  3. Accept the default installation folder C:\MinGW. Do NOT attempt to place in C:\Program Files\MinGW. (location cannot have spaces)
  4. At the Select Component dialog, check the MSYS Basic System.
  5. Add the C:\MinGW\bin folder to your Windows Path variable. To do this:
    1. Right-click on Computer in the Start Menu and selectProperties.
    2. How to Install the MinGW Tools for C/C++ (1)
    3. Click on "Advanced System Settings", choose the Advancedtab, then click Environment Variables.
    4. How to Install the MinGW Tools for C/C++ (2)How to Install the MinGW Tools for C/C++ (3)
    5. Under System Variables, scroll down and select Path, then click Edit.
    6. Carefully (use the right-arrow or End keys) go all the way to the right of the Variable value field. Be sure not to delete anything! Deleting here breaks things!
    7. Add to the end of that field (include the semicolon)

      ;C:\MinGW\bin

      How to Install the MinGW Tools for C/C++ (4)
    8. Click OK three times to exit.
  6. Next, verify that the MinGW install was successful. Here’s how:
    1. Click Start and type cmd in the search field, then press Enter.
    2. In the window that appears, enter gcc and press the Enter key again.
    3. You should get a response gcc: no input files. This means that Windows could find the gcc program, which is what we want. If you get any other response, then verify that you set the path correctly in step 5e above. (For the curious, gcc stands for Gnu C Compiler.)
    4. How to Install the MinGW Tools for C/C++ (5)
How to Install the MinGW Tools for C/C++ (2024)

FAQs

How to Install the MinGW Tools for C/C++? ›

Step 1: Go to the MinGW website and click on Download. It will start downloading in 5 seconds. Step 2: Double click and open the exe MinGW file and click install. It will automatically start downloading all the setups for the MinGW.

How do I download MinGW for C++? ›

MinGW
  1. Click MinGW. The following page will appear in your browser (from the SourceForge web site).
  2. Click the Download mingw-get-setup.exe(86.5 kB) link. ...
  3. Move this file to a more permanent location, so that you can install MinGW (and reinstall it later, if necessary).
  4. Start the Installation instructions directly below.

Does MinGW support C and C++? ›

The MinGW compiler is a well known and widely used software for installing GCC and G++ compilers for the C and C++ programming languages.

How do you check if MinGW is installed or not? ›

After the installation of MinGW is finished. To check if it is installed or not, open Command Prompt and type g++ — version. The MinGW compiler (GCC) is not being detected by the command prompt because the environment path variable has not been set.

How to install MinGW 64 on Windows? ›

Installing the MinGW-W64 C++ Compiler on Windows
  1. Unzip the project file. Navigate to your downloads folder, unzip the installing_mingw_64-master. ...
  2. Unzip the source file. ...
  3. Copy source files. ...
  4. Paste source files. ...
  5. Confirm. ...
  6. You need to set your PATH so windows can find the compiler.

How do I download MinGW installer? ›

Step 1: Go to the MinGW website and click on Download. It will start downloading in 5 seconds. Step 2: Double click and open the exe MinGW file and click install. It will automatically start downloading all the setups for the MinGW.

Do I need MinGW for Dev-C++? ›

Dev-C++ is used for writing, compiling, and executing C++ programs. Internally it uses MinGW (Minimalist GNU for Windows) Compiler. It can be used to code programs in C++ as well as C language. To learn more about C and C++ please refer to C Programming Language and C++ Programming Language.

What compiler should I use for C++? ›

Visual Studio Code FREE

Microsoft provides an open-source cross-platform editor. This editor is well-known for supporting a variety of programming languages, including C++. It includes the greatest C++ compiler and allows you to handle various versions of the same product with ease.

Is it OK to mix C and C++? ›

If the C++ compiler provides its own versions of the C headers, the versions of those headers used by the C compiler must be compatible. Oracle Developer Studio C and C++ compilers use compatible headers, and use the same C runtime library. They are fully compatible.

What is the best compiler to use for C++? ›

1) For modern C++ features the best one compiler will be Clang. Microsoft and gcc are missing a lot from C++11/14 latest features. 2) For C the good ones will be gcc and Oracle C. 3) From the point of efficiency for C++ and C as well, it is Intel C++ Compiler.

What is MinGW installer used for? ›

MinGW ("Minimalist GNU for Windows"), formerly mingw32, is a free and open source software development environment to create Microsoft Windows applications.

Does MinGW work on Windows? ›

Mingw-w64 community triplets

They don't depend on Visual Studio and can be used natively on Windows as well as for cross-compiling on other operating systems. There are two variants of each triplet, selecting between static and dynamic linking. The actual tools (g++ etc.)

How to install MinGW and GCC? ›

C/GCC Compiler
  1. Step 1: Search MinGW C Compiler on the Web. ...
  2. Step 2: Download MinGW. ...
  3. Locate the setup.exe file on your Downloads folder and double-click on it.
  4. After double-clicking on the setup file, MinGW Installation Manager Setup Tool will now open. ...
  5. It is recommended to install it in the default location.

What compiler does MinGW use? ›

MinGW is a compiler system based on the GNU GCC and Binutils projects that compiles and links code to be run on Win32 (Windows) systems.

How to install MinGW in Windows 11 for C? ›

Installing MinGW (or clang)
  1. Go to this website and click either MinGW C/C++ For Windows 11 32/64 bit (for Windows 11) or MinGW C/C++ For Windows 10 32/64 bit (for Windows 10) ...
  2. Run the downloaded file ( mingw.exe ). ...
  3. Click 'Extract'. ...
  4. In Windows search, type 'env' and click on 'Edit the system environment variables':

How do I run a CPP code in terminal? ›

To run the C++ program in your terminal, you need to make sure to change the directory to the one where your program resides, you can use the 'cd <File_Path>' command to change the path and to generate an executable file, the command, 'g++ File_Name. cpp -o FileName', is used.

What compiler do I need for C++? ›

Visual Studio Code FREE

Microsoft provides an open-source cross-platform editor. This editor is well-known for supporting a variety of programming languages, including C++. It includes the greatest C++ compiler and allows you to handle various versions of the same product with ease.

Which compiler can I use for C++? ›

C++ developers on Windows often prefer to use MinGW over other Windows compilers because it offers several benefits. One of the main advantages of MinGW is that it uses the GCC compiler, which the C++ community widely uses and supports.

What compiler does Windows use for C++? ›

The Microsoft C/C++ compiler (MSVC) uses a basic rule to determine which language to use when it compiles your code.

How to install G ++ for C++? ›

Installing c++/g++ on Windows
  1. Pick the drive and a folder in which you want to install g++. ...
  2. Download full.exe, an about 14 megabyte executable, to C:\full.exe by right-clicking on the link. ...
  3. Run the downloaded executable. ...
  4. Locate where the bin folder was created for the g++ installation. ...
  5. Restart your computer.

Top Articles
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated:

Views: 6226

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.