banner



How To Install Mingw On Windows

C/C++ is a general-purpose, mid-level programming language. To get started with C/C++ language we need to install MinGW compiler or an IDE (Integrated development Environment) such as Codeblock, Dev C++ etc.

C and C++ uses aforementioned compiler every bit C++ is a superset of C language simply few programs that may compile in C, but not in C++.

Before writing programs we need a compiler installed on your computer. We can utilise compiler using command prompt and IDE as mention earlier. In this article you volition study both means of compiling your code.

Finding the best Compiler:

In that location are many compiler bachelor to download and install both costless and paid. Some of the compilers are Codeblocks, Dev C++, Visual studio, Netbeans, Turbo C++ etc. And there are many online compiler like ideon.com, codepad.org, codechef which you tin use if don't want to install annihilation.

Note: We use Codeblocks compiled programme on hellocodies.com

Warnin g: If y'all are beginner don't use Turbo C++. Yous endup hating programming with this compiler.

So lets install MinGW on you local environment and all other IDE will exist explained in adjacent commodity.

How to Install MinGW Tools on Windows

1. Download MinGW Tools and Double click the downloaded file to install.

2. A window popup asking yous to change directory ( change if yous desire or leave it)

3. Then click install and click go on

install minGW compiler 1
MinGW tools Installation

iv. Again a new popup window opens asking you lot to select required component

5. Click the tick box and select mark for installation to base of operations-bin, gcc-g++-bin, and gcc-obj-bin (you lot tin likewise select all).

6. From master menu click on Installation>> apply changes and again click Apply. Wait for infinitesimal to install than click shut.

install minGW compiler
MinGW installation

MinGW compiler is installed on your computer. Now you lot accept set path variable for compiler.

1. Open up directory where you installed MinGW>> bin folder and re-create the path (for example: C:\MinGW\bin).

2. Now right click on MY-COMPUTER on desktop. Select Properties >> Advance organisation setting.

3. Click on Environs variable in popup window and click on PATH >> Edit from below options.

install minGW compiler 3
Set compiler path variable

four. Click on New and paste the directory path (C:\MinGW\bin) and click 3 times OK to leave.

install minGW compiler 4
set path variable

Now it'south done compiler installed and path is set

Let'south Verify compiler

Open control prompt and type gcc hit enter.  If information technology shows:

C:\Users\XXXXX>gcc GCC: fatal error: no input file  Compilation stop

it means everything installed and set up properly. Refer beneath paradigm

Try simple C program Instance

  • Open notepad and Copy above code to notepad and salvage it to desktop for easy admission as example.c extension
                #include<stdio.h>  int main() { printf("hellocodies.com")   return 0; }                              
  • Now open command prompt.
  • Type > > cd desktop
  • Changed directory look like this C:\Users\xxxxx\Desktop>
  • Type gcc –o example.exe case.c.
  • Hitting enter
  • Program got compiled now you lot can see a example.exe file on your desktop
  • Type instance.exe in CMD to see output
install minGW compiler 5
C programme example

Case of C++ program

  • Copy beneath program to notepad and save it to desktop with .cpp extension
                #include<iostream> using namespace std;  int main() { cout< <"hellocodies.com";  return 0; }                              
  • Open control prompt
  • Type > > cd desktop
  • Directory look like this C:\Users\xxxxx\Desktop>
  • Type g++ –o example2.exe example2.cpp.
  • Hit enter
  • Program got compiled
  • Type example2.exe to see output
install minGW compiler 6
C++ program example

Improvement later on to come across installation of IDE compilers on windows, mac and Linux platforms.

Don't forget to requite your feedback.

Source: https://www.hellocodies.com/how-to-install-mingw-compiler-on-windows/

Posted by: trujillowito2001.blogspot.com

0 Response to "How To Install Mingw On Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel