Compile, Assemble, and Link from Source Code

Red Hat Enterprise Linux 3: Developer Tools Guide
Prev | Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools | Next

# 3.2. Compile, Assemble, and Link from Source Code

To compile the code, use the following command:

    gcc -g hello.c -o hello

The `-g` option generates debugging information and `-o` specifies the name of the executable to be produced. Both of these can be omitted. Other useful options include `-O` to enable standard optimizations and `-O2` for extensive optimizations. If no `-O` is specified, GCC will not optimize.

See Using the GNU Compiler Collection (GCC) for additional basic compiler information.

Prev | Home | Next
Developing with Red Hat Enterprise Linux Developer Tools | Up | Run the Executable