nld Manual

nld Utility
nld Manual528272-001
2-9
C++ Programs
4. If your program uses active backup programming functions, such as
__ns_start_backup(), link to the active backup programming support object
code file:
5. If you want to overload the new and delete operations, you must link these files
to your program:
For information about active backup programming in C, see the Guardian
Programmer’s Guide.
Example 2-10 takes a C source program named MYSRC, compiles it into an object file
named MYOBJ, and creates a loadfile named MYEXEC. It links to the C run-time library
initialization object file named CRTLMAIN and the SRLs named ZCRESRL and
ZCRTLSRL. In the Guardian environment, ZCRESRL and ZCRTLSRL are located in the
active SYSnn subvolume.
C++ Programs
There are three versions of C++:
When you compile a C++ program, you can specify its version with the command-line
directive VERSION1, VERSION2, or VERSION3. The default is VERSION3.
Environment Active Backup Programming Support Object Code File
Guardian $SYSTEM.SYSTEM.CRTLNS
OSS /usr/lib/crtlns.o
Environment Active Backup Programming Support Object Code File
Guardian $SYSTEM.SYSTEM.CPPINIT
OSS /usr/lib/cppinit.o
Example 2-10. Creating an Executable C Program
Guardian Environment
NLD $SYSTEM.SYSTEM.CRTLMAIN MYOBJ -o MYEXEC &
-l ZCRESRL -l ZCRTLSRL
OSS Environment
nld /usr/lib/crtlmain.o myobj -o myexec -l zcresrl -l zcrtlsrl
Version
Conforms to ANSI and
ISO Standards for C++ Supports PIC (position-independent code)
1No No
2No Yes
3 (default) Yes Yes