GNU Compiler Collection
Any of GCC's supported languages may be compiled through the simple command-line construct:
However, some languages depend on the linking of libraries, such as C++'s Standard Template Library, to reach their full potential. In GCC, one way to include the STL is to change the way the compiler is called:
In the above two examples, GCC will produce a binary file named a.out, barring any compile-time errors. This is the executable form of the code compiled. If it is preferable to have a binary of a different name, and it usually is, one can use the -o command-line option:
gcc (source-file) -o mybinary
g++ (source-file) -o mybinary
These example behaves the same as their sibling examples, with the exception that they create a binary named mybinary instead of a.out.
- GCC official home page
- GNU Compiler Collection on Wikipedia
- GCC online documentation
- An incomplete list of third-party binary distributions for systems that don't already have a compiler installed.
- MinGW, a widely-used port of GCC to Windows
- TDM-GCC, another Windows port (not listed in the third-party distribution page above)
- DJGPP, a widely-used port of GCC to DOS