C/C++ Programmer's Guide (G06.25+)

Compiling, Binding, and Accelerating TNS C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
15-17
Working in the G-Series OSS Environment
TNS c89 Operands
An operand is in the form of either a pathname or -l library. Note also that TNS
c89 recognizes the operands in Table 15-3.
Input Files
Input files to TNS c89 can be:
C++ language source files
TNS object files generated by c89 -c
Libraries of TNS object files produced by the ar utility
Libraries of TNS object files produced by Binder
Executable TNS object files produced by Binder
Binding
The -lc and -lC operands specify the following libraries:
In the absence of options that inhibit the invocation of the Binder, such as -c or
-Wnobind, the TNS c89 utility causes the equivalent of a -lc operand to be passed
to the Binder as the last -l operand, causing the standard TNS C library to be
searched after all other object files and libraries are loaded.
If one or more of the file operands are C++ source files, TNS c89 causes the
equivalent of a -lC operand to be passed to the Binder ahead of -lc. However, if a
separate binding process is invoked to bind C++ TNS object files, you are required to
specify -lC as one of the file operands ahead of -lc. If you do not specify -lC ahead
of -lc only the standard TNS C run-time library is used by the Binder.
Examples
Examples 1 and 2 show how to compile a C++ program using the TNS c89 utility.
Example 3 shows how to perform some of the compilation steps without performing all
of them.
Table 15-3. TNS c89 Operands
Operand Function
-lc This library contains all library functions specified in the POSIX.1
specification, except for those functions listed as residing in math.h.
-lC This is the TNS C++ run-time library. It should be bound before the standard
TNS C run-time library.