Install, set, and use mingw in win7

Source: Internet
Author: User
1. Introduction

Mingw is the abbreviation of "minimalist GCC windows ". in short, mingw is the GCC in Windows [2]. if mingw is installed in windows, C/C ++, Fortran, and other language compiler suites are installed. mingw is completely free. with mingw, commercial compilers such as Vc and virtual Fortran are not required.

This article will share with you the entire process of mingw installation, setup, and debugging in win7. We strongly recommend that you use open-source free mingw instead of pirated VC and other compilers!

2. Download and install mingw2.1mingw

Http://www.mingw.org/

2.2 download and install mingw

Mingw's installation files are not on its official website, but in the open-source community "SourceForge ". you can search for mingw from the mingw official website or SourceForge. we recommend that you go to the mingw official website. The path is:

Click "documentation =>" Getting started "on the mingw home page to go to the following page:

Click mingw-get-Inst connection To Go To The SourceForge website to store mingw:

Download the "mingw-get-inst-20120426.exe" file to any directory on your computer brain.

Click to run the mingw-get-inst-20120426.exe and start to install mingw.

Step 1

Step 2.

Step 3

Step 4

Step 5

Step 6:

Finally, the previous upload mingw-get-inst-2012020..exe is just a header file. Its function is to connect, download mingw, and install it. In this step, download mingw from SourceForge. if you select multiple compilers such as C/C ++ and FORTRAN at the same time, this step will take a long time.

3. Set environment variables for mingw in Windows

In this case, mingw cannot be used. You must set environment variables for mingw in Windows. The specific method is as follows:

Double-click the path column. Because the mingw is installed in the C: \ mingw directory, c: \ mingw \ bin is added to the original path;

OK! Now mingw can be used.

4. Hello World

Edit, compile, and run a C program.

Step 1:Use NotePad to edit the following program:

#include <stdio.h>main(){printf("Hello World!\n");return 0;}

Write and save it to any directory, such as D: \ Temp. The file name is "Hello. c"

Step 2:Start DOS prompt

Enter D: \ Temp

Step 2 compile hello. c

Step 3 run

After compilation, an a.exe will be compiled, and "Hello World!" will be displayed after running! "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.