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

Compiling a Module
The native compilers translate the source text of a module and produce:
An extensive compiler listing; several pragmas enable you to control the content of this compiler
listing
A nonexecutable object file (if the compiler encountered no errors during the compilation)
After compiling all the modules that compose your program, you collect and combine them into a
program file (an executable object file) by using the eld utility.
If your program comprises a single module, you can use the RUNNABLE pragma to direct the
compiler to produce a program file instead of a nonexecutable object file.
If your program comprises more than one module, you can use the RUNNABLE and LINKFILE
pragmas to direct the compiler to produce a linked program file instead of a nonexecutable object
file. For more details, see pragma LINKFILE (page 213).
To use the RUNNABLE pragma, one of the modules must contain the main function of the program.
The CCOMP command invokes the TNS/E native C compiler. The CPPCOMP command invokes
the TNS/E native C++ compiler. The syntax for these commands is shown in this diagram.
[ RUN ] { CCOMP | CPPCOMP } / IN source [ , OUT listing ]
[ , run-options ] / [ object ]
[ ; compile-option [ , compile-option ]... ]
compile-option:
{ pragma }
{ define identifier [ constant ] }
{ undefine identifier }
[ RUN ] CCOMP
is the TACL command to start the TNS/E native C compiler process. The RUN command keyword
is optional.
[ RUN ] CPPCOMP
is the TACL command to start the TNS/E native C++ compiler process. The RUN command
keyword is optional.
IN source
specifies the primary source file of the module. The file must be a valid Guardian file name for
either a type 101 (EDIT) or type 180 disk file. Interactive input from a terminal or a process is
not accepted.
OUT listing
specifies the file to which the native 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. If the file already exists, the compiler attempts to delete
the file and continue.
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 TNS/E native C or 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 ZZLDFnnn (where nnn is a unique three-digit number)
in your current default volume and subvolume.
Working in the Guardian Environment 305