GNU Compiler Collection: Difference between revisions

m
Added formatting and intra-site links.
m (Added to the encyclopedia.)
m (Added formatting and intra-site links.)
Line 1:
{{encyclopedic}}The '''GNU Compiler Collection''', or '''GCC''', is a multilanguage compiler supporting multiple target architectures. As of version 4.1, the main branch includes support for [[Ada]], [[C]], [[C++]], [[Fortran]], [[Java]], [[Objective-C]], and [[Objective-C++]]. Support for other languages is possible through the creation of a compiler front-end.
 
==Basic Usage==
Line 7:
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:
<pre>g++ (source-file)</pre>
In the above two examples, GCC will produce a binary file named '''<tt>a.out'''</tt>, 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 '''<tt>-o'''</tt> command-line option:
<pre>gcc (source-file) -o mybinary</pre>
''or''
<pre>g++ (source-file) -o mybinary</pre>
These example behaves the same as their sibling examples, with the exception that they create a binary named '''<tt>mybinary'''</tt> instead of '''<tt>a.out'''</tt>.
 
==See Also==
Anonymous user