TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

C++

Install GNU C/C++ Compiler on Windows

Overview

In this tutorial, we will install GNU C/C++ Compiler on Windows operating system. GNU is a recursive acronym and stands for GNU is Not Unix. To install GCC on Windows we need to install MinGW. MinGW stands for “Minimalist GNU for Windows“. It is a minimalist development environment for native Microsoft Windows applications.

Check Install

Let’s first check if GNU C/C++ Compiler is installed or configured on the system.

Open the Windows Command Prompt and run the following command.

\> g++ –version

GNU Compiler Windows

If the output of the command is something like  “g++ is not recognized as an internal or external command, operable program or batch file” then the GNU compiler is not installed or configured on the machine.

Download

To install MinGW, navigate to the SourceForge website. The installer is hosted on the SourceForge hosting platform.

https://sourceforge.net/projects/mingw/

 

MinGW GNU for Windows Download

Click the Download button. The file would download to the browser download folder.

The filename would be mingw-<version>-setup.exe

or

mingw-get-setup.exe

Install

Locate the installer in the download folder and double-click on the  MinGW install manager setup.

MinGW Installation Manager1

Click on the Install button.

The following install screen window will appear. The default install location is: C:\MinGW

We can choose to install the software in any directory. However, it’s always recommended to install the software in the default install directory.

Other install preferences.

  • Graphical User Interface support
  • Install for All users or just for you
  • Start Menu folder
  • Desktop shortcut icon

MinGW Install Preferences

Click on the Continue button.

The following install screen will appear.

MinGW Basic Setup

Choose the setup type. Ensure on the left that Basic Setup is selected.

Select the basic packages::
mingw32-base
mingw32-gcc-g++
msys-base.

Right-click on the package and select Mark for Installation. However, you can select more packages for other languages support.

MinGW Apply Changes

Choose Installation >> Apply Changes menu option to install the selected packages.

Click on the Apply button to install the packages.

The packages would be installed on the machine. We can add the bin subdirectory to the system PATH environment variable.

 

gnu-g++-Compiler

 

The command should display the command output. For example,

c:\mingw\bin>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure –build=x86_64-pc-linux-gnu –host=mingw32 –with-gmp=/mingw –with-mpfr=/mingw –with-mpc=/mingw –with-isl=/mingw –prefix=/mingw –disable-win32-registry –target=mingw32 –with-arch=i586 –enable-languages=c,c++,objc,obj-c++,fortran,ada –with-pkgversion=’MinGW.org GCC-6.3.0-1′ –enable-static –enable-shared –enable-threads –with-dwarf2 –disable-sjlj-exceptions –enable-version-specific-runtime-libs –with-libiconv-prefix=/mingw –with-libintl-prefix=/mingw –enable-libstdcxx-debug –with-tune=generic –enable-libgomp –disable-libvtv –enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)

That’s it, MinGW is now installed on the machine. Now, we can compile and run C++ programs on the Windows machine.

Code::Blocks IDE

Another alternative to getting a GNU C/C++ compiler is to install an IDE that bundles the compiler. The easiest way to install a GNU compiler and an IDE for programming is to install Code::Blocks IDE.

Steps to install Code::Blocks IDE:

https://www.testingdocs.com/download-and-install-codeblocks/

That’s it. MinGW mingw32-gcc-g++ Compiler package provides the implementation of the GNU C++ language compiler. We require this to compile C and C++ programs.

GNU Compiler version command

Official Website

For more information on MinGW, visit the following website:

https://www.mingw-w64.org/

—

C++ Tutorials

C++ Tutorials on this website:

https://www.testingdocs.com/c-coding-tutorials/

For more information on the current ISO C++ standard

https://isocpp.org/std/the-standard

Related Posts

g not found OpenSuse

C++ /

Install GCC C++ Compiler on OpenSuse

sum of digits c program

C++ /

Sum of Digits of a Number C++ Program

C++ Hello World Program

C++ /

C++ Hello World Program

C++ /

C++ Program to Find Quadratic Equation Roots

C Class Constructor

C++ /

Define C++ Class Constructor

‹ History of C++ Language› C++ Program Structure

Recent Posts

  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Print Triangle Pattern Flowchart
  • RAPTOR Editions
  • Flowgorithm Conditional Breakpoint Statement
  • Flowgorithm Read Numbers from File Example
  • Search Text File Flowchart Example
  • Flowgorithm Turtle Graphics Symbols
  • Draw Circle using Flowgorithm Turtle

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version