C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

While header files are optional (but strongly recommended) for programs that contain Guardian
or OSS modules exclusively, header files are required for mixed-module programs. If you do not
compile using header files, the Binder cannot correctly resolve external references to Guardian C
and OSS functions.
Working in the Guardian Environment
In the Guardian environment, you can compile, bind, and accelerate C programs for either the
Guardian or G-series Open System Services (OSS) environment. In the Guardian environment,
you use the C compiler, the Binder (the BIND program), and the Accelerator (the AXCEL program)
or OCA to develop your applications.
Compiling a C Module
The C compiler translates the source text of a module and produces these:
An extensive compiler listing. Several pragmas enable you to control the content of this compiler
listing.
A nonexecutable object file, provided that the compiler encountered no errors during the
compilation. If your C program comprises only a single module, use the RUNNABLE pragma
to direct the compiler to produce a program file instead of a nonexecutable object file.
After compiling all the modules that compose your C program, use Binder to collect and combine
them into a program file (an executable object file).
To compile a module, you start the C compiler process using the TACL command RUN as shown
in this diagram:
[ RUN ] C / IN source [ , OUT listing ] [ , run-options ] /
[ object ] [ ; compile-option [ , compile-option ]... ]
compile-option:
{ pragma }
{ define identifier [ integer-constant ] }
{ undefine identifier }
[ RUN ] C
is the TACL command to start the C compiler process. Note that the command keyword RUN
is optional.
IN source
specifies the primary source file of the module.
OUT listing
specifies the file to which the C compiler writes the compiler listing. When specified, listing
is usually a spooler location. If you omit the OUT option, the compiler writes the listing to your
current default output file.
run-options
is a comma-separated list of additional options for the RUN command. These options are
described in the TACL Reference Manual.
object
specifies the file to which the C compiler writes the object code for the source text. If you do
not specify an object file, the compiler writes the object code to the file OBJECT in your current
default volume and subvolume. If OBJECT cannot be created, the compiler writes the object
code to the file ZZBInnnn (where nnnn is a unique four-digit number) in your current default
volume and subvolume.
Working in the Guardian Environment 263