Computer languages such as C and C++, Cobol, Fortran, and
others, are known as "compiled" languages. The programmer edits or
enters his program into a series of source files and runs it through a compiler
that produces object files, which are snippets of executable program suitable
for use on a specific processor and operating system. A loader then connects
all the object files necessary for making a complete application—together with
standard libraries— into an executable program file.
gcc, cc, and other compilers are available. The general
form for compiling a program written in C is:
% gcc -o filename.out filename.c
where filename.c is the source file, and filename.out is
the name you want to give the binary. cc, gcc and g++ have many command line
options. For more detailed information on these, we suggest initially looking
at the Man pages:
% man gcc
% man cc
As one final note, there are man pages for some standard
library functions, such as malloc(). The
example with malloc() is especially
pertinent, as it and other functions that relate to it are stored in the stdlib.h
header file (which is something you can find out from the man pages, but
otherwise might throw you for a loop).
|