C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

For a given version, you can link only to the SRLs listed in the column or stack for that version in
Table 45: SRLs Available When Using VERSION1, VERSION2, and VERSION3. If you attempt to
link to SRLs that are listed in another column, unexpected results can occur. The order of the column
or stack is also important, especially for TNS/R native C++, because it represents the order in
which libraries should be loaded and accessed at run time.
For example, if you are using VERSION1 on Guardian, you can link to ZTLHGSRL (Tools.h++
version 6), but you cannot link to ZTLHSRL (Tools.h++ version 7). Similarly, if you are using
VERSION3, you cannot link to ZRWSLSRL (the VERSION2 Standard C++ Library).
Note that ZSTLSRL in VERSION3 contains both the C++ run-time library and the latest Standard
C++ Library. The C++ run-time library is available to VERSION1 as ZCPLGSRL or ZCPLOSRL,
and to VERSION2 as ZCPLSRL, while the latest Standard C++ Library is only available to
VERSION3 (the earlier version of the library is available to VERSION2 as ZRWSLSRL).
Table 45 SRLs Available When Using VERSION1, VERSION2, and VERSION3
VERSION 3VERSION 2VERSION 1
OSSOSSOSSGuardianOSSGuardian
N.A.N.A.TLHTLHTLHOTLHG
STLSTLRWSLRWSLN.A.N.A.
STLSTLCPLCPLCPLOCPLG
CRTLCRTLCRTLCRTLCRTLCRTL
CRECRECRECRECRECRE
OSSOSOSSOSOSSOS
OSOSOSOSOSOS
Notes: SRL names are shown without the leading Z and these SRL; therefore, STL represents ZSTLSRL (the combined
C++ run-time library and the C++ Standard Library for VERSION3), and TLH represents ZTLHSRL (the Tools.h++ library
for VERSION2).
OS represents the operating system. OSS represents the Open System Services environment.
CRE represents the common run-time environment.
For more details, see:
Using the Standard C++ Library
Pragmas VERSION1 (page 252), VERSION2 (page 254), and VERSION3 (page 255)
C++ Run-Time Library and Standard C++ Library (page 34)
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), these 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 TNS/R native linker explicitly, you need to include these SRLs in the link
command using the -lib option, as shown in Table 46: Using the Guardian TNS/R Native Linker
Utilities to Link SRLs .
296 Compiling and Linking TNS/R Native C and C++ Programs