C/C++ Programmer's Guide (G06.25+)
Compiling, Binding, and Accelerating TNS C++ 
Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
15-8
Working in the Guardian Environment
To send error and warning messages to a file, assign stderr to the desired file 
name prior to invoking Cprep. You assign stderr to a file name as follows:
ASSIGN STDERR, file-name
To return to the default location, enter:
CLEAR ASSIGN STDERR
Example:
•
In this example, the intermediate file intfile1, which was previously created by 
Cprep, is now input to Cfront. An intermediate file, intfile2, is created by Cfront 
for later use by the C compiler.
CFRONT/ IN intfile1, OUT intfile2 /
TNS C Compiler Run Command Syntax
The TNS C compiler compiles the output from Cfront and produces a compiler listing 
and a TNS object file, provided that the compiler encounters no errors during the 
compilation.
If your program has multiple compilation units, you use Binder to combine the TNS 
object files produced by the C compiler into one executable TNS object file.
If your program comprises a single compilation unit, you can use the RUNNABLE 
pragma in the C++ source file or on the Cprep run command line to direct the TNS 
C compiler to produce an executable TNS object file without having to run the Binder.
You use the following syntax to run the TNS C compiler: 
IN intermediate-file2
specifies the name of the file that contains the output from Cfront.
OUT listing
specifies the file to which the TNS 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, usually the terminal.
When you run the TNS C compiler, error and warning messages are sent to 
listing (stdout), not stderr.
run-options
is a comma-separated list of additional options for the RUN command. These 
options are described in the TACL Reference Manual.
[ RUN ] C / IN intermediate-file2, OUT listing ]
 [ , run-options ] / [ object ] [ ; pragma [ , pragma ]...]










