C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
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/R 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 ZZBInnnn (where nnnn is a unique four-digit number)
in your current default volume and subvolume. If you are compiling PIC, the compiler writes
the object code to ZZLDFnnn.
compile-option
modifies compiler operation by specifying a compiler pragma or defining a preprocessor
symbol.
pragma
is any valid command-line compiler pragma.
define identifier [ constant ]
defines identifier as a preprocessor symbol. If identifier is followed by a constant,
identifier is defined as an object-like macro that expands to the given value. define
is equivalent to using the #define preprocessor directive in source text.
undefine identifier
deletes identifier as a preprocessor symbol. Using undefine is equivalent to using the
#undef preprocessor directive in source text.
Usage Guidelines
• The compiler accesses source files as text-type logical files. Consequently, the source files you
specify in a module must represent physical file types that the compiler can access as text-type
logical files.
• The compiler returns one of these completion codes:
The compilation completed successfully.0
The compilation completed with warnings (but no errors).1
The compilation completed with errors.2
The compiler terminated abnormally as the result of an internal error.3
Examples
1. Directing the compiler to translate the source file ABSC (which contains an entire C++ program),
sending the compiler listing to the device $S.#ABSL, storing the object file under the name
ABSO, and using the default VERSION3 library:
> NMCPLUS /IN absc, OUT $s.#absl/ abso;
2. Disabling the run-time diagnostics that the assert function can issue by defining NDEBUG as
a preprocessor symbol:
> NMC /IN appc, OUT $s.#appl/ appo; define NDEBUG
3. Generating a TNS/R native object file for the OSS environment:
> NMC /IN filec / fileo; SYSTYPE OSS
4. Generating an executable TNS/R native program from a single module:
Working in the Guardian Environment 293