01.09.2014 Views

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CH03.fm Page 45 Monday, October 7, 2002 8:33 PM<br />

Introduction to GNU C <strong>and</strong> C++ Compilers 45<br />

•C<br />

• C++<br />

•Fortran<br />

• Objective C<br />

•Java<br />

Front-end preprocessors for many other languages also exist for GCC. For example, you<br />

can use a Pascal language front end with GCC.<br />

C is the primary language <strong>and</strong> GCC supports ANSI/ISO st<strong>and</strong>ards put forward in 1989-90<br />

<strong>and</strong> 1995-96. <strong>The</strong>se st<strong>and</strong>ards are also sometimes called C90 <strong>and</strong> C95, respectively. Another<br />

revision of the ANSI/ISO C language st<strong>and</strong>ard was made in 1999 (known as C99), <strong>and</strong> GCC<br />

does not yet fully support this revision. You can find out the current status of support for this<br />

revision at http://gcc.gnu.org/gcc-3.0/c99status.html.<br />

Support for these variations in st<strong>and</strong>ards can be selected using comm<strong>and</strong> line switches<br />

when compiling programs. For example, to compile programs according to original 1989-90<br />

st<strong>and</strong>ards, you can use one of the following comm<strong>and</strong> line switches:<br />

-ansi<br />

-std=c89<br />

-std=iso9899:1990<br />

<strong>The</strong> GCC compiler supports Objective C source code. Information on Objective C can be<br />

found in different books <strong>and</strong> online resources. However there is no st<strong>and</strong>ard for Objective C yet.<br />

Later in this chapter you will learn how to compile a simple program written in Objective C.<br />

GCC supports GNU Fortran language <strong>and</strong> we shall discuss later in this chapter how to<br />

compile programs written in Fortran.<br />

Support for Java is a new addition to GCC <strong>and</strong> we shall see how GCC h<strong>and</strong>les Java code<br />

with the GCJ compiler. This compiler, which is a part of the GCC family of compilers, can create<br />

an executable object from Java source code files.<br />

St<strong>and</strong>ard libraries are not part of the GCC compiler. You have to separately install libraries.<br />

<strong>The</strong> most common library used with the compiler is the GNU C library <strong>and</strong> we shall see how<br />

to get <strong>and</strong> install this library on <strong>Linux</strong> systems. <strong>The</strong> GNU C library (also known as glibc) provides<br />

support for:<br />

• ANSI/ISO C<br />

•POSIX<br />

•BSD<br />

• System V<br />

• X/Open<br />

For more information on languages supported by GCC, please see http://gcc.gnu.org/<br />

onlinedocs/gcc-3.0.2/gcc_2.html.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!