How to Use the GCC compiler in Windows

Source: Internet
Author: User

How to Use the GCC compiler in Windows

The GNU Compiler Collection has des front endsfor C, C ++, objective-C, Fortran, Java, Ada,
And go, as well as libraries for these operating ages (libstdc ++, libgcj,...). GCC was originally written as the compiler for the gnuoperating system. The GNU system
Was developed to be 100% freesoftware, free in the sense that it respectsthe user's freedom.

After mingw is installed, files such as <gcc.exe/g77.exe> are found in the bin folder under the root directory.

To test, I created a new test. BAT file in this folder and wrote the following content:

GCC test. cpp

Create the test. cpp file in the folder and set its content:

# Include <stdio. h> </P> <p> int main () </P> <p >{</P> <p> printf ("hello. GCC \ n "); </P> <p> getchar (); </P> <p> return0; </P> <p>}

Double-click the test.batfile and find that an a.exe file is stored in the folder. Execute the EXE file and find that the file is consistent with the expected compilation result, indicating that the compilation is successful.

 

Gcc-O name test. cpp

The executable name named name.exe can be generated.Program.

 

After changing the command to GCC-E test. cpp> test.txt, an error is prompted.

GCC: no input files

 

After the parameter E is changed to uppercase, the problem is solved:

Gcc-E test. cpp> test.txt

Related Article

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.