GNU Compiler Collection: Difference between revisions
Content added Content deleted
m (Put the div box in the right place) |
m (Links fixed) |
||
Line 5: | Line 5: | ||
Any of GCC's supported languages may be compiled through the simple command-line construct: |
Any of GCC's supported languages may be compiled through the simple command-line construct: |
||
<pre>gcc (source-file)</pre> |
<pre>gcc (source-file)</pre> |
||
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: |
However, some languages depend on the [[link time|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> |
<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 |
In the above two examples, GCC will produce a binary file named <tt>a.out</tt>, barring any [[compile time|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> |
<pre>gcc (source-file) -o mybinary</pre> |
||
''or'' |
''or'' |