C/C++ Programmer's Guide (G06.25+)
Compiling and Linking TNS/R Native C and C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
16-16
Linking a Module
Additional SRLs might be required for other run-time libraries and services. For
example, if you use the VERSION2 pragma with the NMCPLUS driver in the Guardian
environment (or the -Wcplusplus and -Wversion2 flags with the c89 driver in the
OSS environment), the following SRLs are automatically searched:
•
ZCPLSRL (the C++ run-time SRL)
•
ZRWSLSRL (the VERSION2 Standard C++ Library SRL)
•
The SRLs in LIBCOBEY
If, however, you invoke nld or ld explicitly, you need to include these SRLs in the link
command using the -lib option, as shown in Table 16-6, Using the Guardian nld and
ld Utilities to Link SRLs.
Table 16-6. Using the Guardian nld and ld Utilities to Link SRLs (page 1 of 2)
If your program uses: You should specify these nld/ld utility flags:
C run-time library and runs in the
Guardian environment
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
or
-l ZCRTLSRL -l ZCRESRL
C run-time library and runs in the
OSS environment
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
or
-l ZCRTLSRL -l ZCRESRL -l ZOSSKSRL
-l ZOSSFSRL -l ZSECSRL -l ZI18NSRL
-l ZICNVSRL -l ZOSSESRL -l ZINETSRL
-l ZOSSHSRL -l ZSTFNSRL
VERSION2 C++ run-time library
and runs in the Guardian
environment
-l ZRWSLSRL -l ZCPLSRL
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
or
-l ZRWSLSRL -l ZCPLSRL -l ZCRTLSRL
-l ZCRESRL
VERSION2 C++ run-time library
and runs in the OSS
environment
-l ZRWSLSRL -l ZCPLSRL -l ZOSSHSRL
-l ZSTFNSRL
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
or
-l ZRWSLSRL -l ZCPLSRL -l ZCRTLSRL
-l ZCRESRL -l ZOSSKSRL -l ZOSSFSRL
-l ZSECSRL -l ZI18NSRL -l ZICNVSRL
-l ZOSSESRL -l ZINETSRL -l ZOSSHSRL
-l ZSTFNSRL
VERSION2 Standard C++
Library, Tools.h++ (version 7)
and runs in the Guardian
environment
-l ZTLHSRL -l ZRWSLSRL -l ZCPLSRL
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
or
-l ZTLHSRL -l ZRWSLSRL -l ZCPLSRL
-l ZCRTLSRL -l ZCRESRL