Configuration of GCC (mingw) in Windows

Source: Internet
Author: User
1. GCC

GCC (GNU Compiler Collection) is an excellent C ++ compiler and part of the GNU program.

GCC can only be used in Unix or Linux environments at first, and then mingw appears, so that GCC can be used in windows.

2. Install mingw

Mingw can be directly installed or indirectly installed by installing QT creator. Here I install mingw by installing qtcreator-2.4.1.

After installation, the mingw directory is c: \ QT \ qtcreator-2.4.1 \ mingw.

3. environment variable configuration

Add inclue and path to user variables, which are c: \ QT \ qtcreator-2.4.1 \ mingw \ include and c: \ QT \ qtcreator-2.4.1 \ mingw \ bin

4. Compile the connection

Now you can use the GCC command in cmd.

The following sectionCode

// Hello. cpp # include <iostream> int main () {STD: cout <"Hello, world! \ N ";}

Under cmd, switch the directory to the current CPP directory.

Then run gcc-O hello. cpp.

Compile and compile an executable file hello.exe quickly.

Run the command in cmd to display Hello, world!

 

 

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.