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