117 lines
6.3 KiB
HTML
117 lines
6.3 KiB
HTML
<HTML>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<!-- Created on March, 17 2001 by texi2html 1.64 -->
|
|
<!--
|
|
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
|
Karl Berry <karl@freefriends.org>
|
|
Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
and many others.
|
|
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
|
|
|
|
-->
|
|
<HEAD>
|
|
<TITLE>Using and Porting the GNU Compiler Collection (GCC): G++ and GCC</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Using and Porting the GNU Compiler Collection (GCC): G++ and GCC">
|
|
<META NAME="keywords" CONTENT="Using and Porting the GNU Compiler Collection (GCC): G++ and GCC">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
<META NAME="Generator" CONTENT="texi2html 1.64">
|
|
|
|
</HEAD>
|
|
|
|
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
|
|
|
|
<A NAME="SEC1"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<A NAME="G++ and GCC"></A>
|
|
<H1> 1. Compile C, C++, Objective C, or Fortran </H1>
|
|
<!--docid::SEC1::-->
|
|
<P>
|
|
|
|
<A NAME="IDX2"></A>
|
|
The C, C++, and Objective C, and Fortran versions of the compiler are
|
|
integrated; this is why we use the name "GNU Compiler Collection".
|
|
GCC can compile programs written in C, C++, Objective C, or Fortran.
|
|
The Fortran compiler is described in a separate manual.
|
|
</P><P>
|
|
|
|
<A NAME="IDX3"></A>
|
|
"GCC" is a common shorthand term for the GNU Compiler Collection. This is both
|
|
the most general name for the compiler, and the name used when the
|
|
emphasis is on compiling C programs (as the abbreviation formerly
|
|
stood for "GNU C Compiler").
|
|
</P><P>
|
|
|
|
<A NAME="IDX4"></A>
|
|
<A NAME="IDX5"></A>
|
|
When referring to C++ compilation, it is usual to call the compiler
|
|
"G++". Since there is only one compiler, it is also accurate to call
|
|
it "GCC" no matter what the language context; however, the term
|
|
"G++" is more useful when the emphasis is on compiling C++ programs.
|
|
</P><P>
|
|
|
|
We use the name "GCC" to refer to the compilation system as a
|
|
whole, and more specifically to the language-independent part of the
|
|
compiler. For example, we refer to the optimization options as
|
|
affecting the behavior of "GCC" or sometimes just "the compiler".
|
|
</P><P>
|
|
|
|
Front ends for other languages, such as Ada 9X, Fortran, Modula-3, and
|
|
Pascal, are under development. These front-ends, like that for C++, are
|
|
built in subdirectories of GCC and link to it. The result is an
|
|
integrated compiler that can compile programs written in C, C++,
|
|
Objective C, or any of the languages for which you have installed front
|
|
ends.
|
|
</P><P>
|
|
|
|
In this manual, we only discuss the options for the C, Objective-C, and
|
|
C++ compilers and those of the GCC core. Consult the documentation
|
|
of the other front ends for the options to use when compiling programs
|
|
written in other languages.
|
|
</P><P>
|
|
|
|
<A NAME="IDX6"></A>
|
|
<A NAME="IDX7"></A>
|
|
<A NAME="IDX8"></A>
|
|
G++ is a <EM>compiler</EM>, not merely a preprocessor. G++ builds object
|
|
code directly from your C++ program source. There is no intermediate C
|
|
version of the program. (By contrast, for example, some other
|
|
implementations use a program that generates a C program from your C++
|
|
source.) Avoiding an intermediate C representation of the program means
|
|
that you get better object code, and better debugging information. The
|
|
GNU debugger, GDB, works with this information in the object code to
|
|
give you comprehensive C++ source-level editing capabilities
|
|
(see section `C and C++' in <CITE>Debugging with GDB</CITE>).
|
|
</P><P>
|
|
|
|
<A NAME="Invoking GCC"></A>
|
|
<HR SIZE="6">
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<BR>
|
|
<FONT SIZE="-1">
|
|
This document was generated
|
|
by <I>GCC Administrator</I> on <I>March, 17 2001</I>
|
|
using <A HREF="tppmsgs/msgs0.htm#1" tppabs="http://www.mathematik.uni-kl.de/~obachman/Texi2html"><I>texi2html</I></A>
|
|
|
|
</BODY>
|
|
</HTML>
|