Section 11.2. C Compilers


[Page 400 (continued)]

11.2. C Compilers

Traditionally, a C compiler was a standard component in UNIX, especially versions that came with source code (how else would you modify the code and create a new kernel?). Linux distributions include GNU C (gcc) and GNU C++ (g++) and will be on any system where the developer package(s) have been installed. If you're an old UNIX hack, /usr/bin/cc is a link to /usr/bin/gcc, so you can still type "cc" to invoke gcc. The GNU C compiler works like this:

Figure 11-1. Description of the gcc utility.

Utility: gcc -cv [ -o fileName ] [ -pg ] { fileName }*

The gcc utility compiles C program code in one or more files and produces object modules or an executable file. Files specified should have a ".c" extension. Use the -c option to produce object modules suitable for linking later. Use the -o option to specify a filename other than the default "a.out" for the executable. Use the -pg option to produce profiling data for the GNU profiler gprof. Use the -v option to produce verbose commentary during the compilation and/or linking process.





Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net