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

Table Of Contents
Compiling, Binding, and Accelerating TNS C
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
14-4
Working in the Guardian Environment
For more details, see the TNS c89 online reference page. To view this reference page,
enter:
man -M /nonnative/usr/share/man c89
The c89 reference page in D40 and later versions of the Open System Services Shell
and Utilities Reference Manual describes the native c89 utility.
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 }