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
15-11
Working in the Guardian Environment
Before compiling this program, purge any existing intermediate files:
purge intfile1
purge intfile2
To compile this program, enter these run commands:
cprep/in progcp, out intfile1/define __cplusplus, &
SSV0 "$system.system"
cfront/in intfile1, out intfile2/
c/in intfile2, out $s.#hold/progo
To run this program, enter:
run progo
The program will respond with:
Hello World
Error Messages in the Guardian Environment
This subsection provides information on the compile-time and run-time error messages
that are generated in the Guardian environment.
Compile-Time Error Messages
Cprep and Cfront generate completion codes and send error and warning messages to
stderr.
Cprep and Cfront each follow the standard HP convention of generating completion
codes to indicate the presence of error or warning messages. The completion codes
have these significance:
If you are running Cprep or Cfront interactively, these completion codes appear on your
terminal screen as a source of information. For example, if Cfront encounters errors
and stops processing, it will emit this message:
2: Process terminated with fatal errors or diagnostics
If you are running in batch mode, Cprep and Cfront sends completion codes to the
command interpreter. You can use TACL to check for these completion codes. For an
example of how to check for these completion codes, see the TACL macro in
Appendix B, TNS C++ Implementation-Defined Behavior.
Cprep and Cfront both send error and warning messages to stderr. The default
location for stderr is the terminal. You can assign stderr to a specific file and
collect all Cprep and Cfront error and warning messages there. The messages
generated by Cfront contain (CFRONT): at the start of the message.
Completion Code Significance
1 Compilation completed with warnings, but no errors.
2 Errors occurred, and processing terminated.