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

Table Of Contents
Compiling and Linking TNS/E Native C and C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
17-14
Linking a TNS/E Module
You use the eld utility to create a linkable object file or linkfile. You can also use eld to
create an executable (known as a loadable object file or a loadfile) in PIC format that
can function as a dynamic-link library (DLL).
Shared run-time libraries are not supported for TNS/E code.
Determining Which DLLs are Required
The DLLs that are required by a program depend on whether the program:
Runs in the NonStop environment
Uses the C run-time library
Uses the C++ run-time library
Uses the Tools.h++ library (and whether Version 6.1 or Version 7)
Uses the Standard C++ Library
Uses the TCP/IP sockets library
Table 17-5 is a conceptual stack of the DLLs that make up the context of VERSION2
and VERSION3. In this table, CPPC represents the DLL named ZCPPCDLL (the C run-
time library). ZCPP2DLL is given as CPP2 (the VERSION2 Standard C++ Library).
For a given version, you can link only to the DLLs listed in the column or stack for that
version in Table 17-5. If you attempt to link to DLLs that are listed in another column,
unexpected results can occur. The order of the column or stack is also important,
especially for TNS/E native C++, because it represents the order in which libraries
should be loaded and accessed at run time.
For example, if you are using VERSION2 on Guardian, you can link to ZTLH7DLL
(Tools.h++ version 6), but you cannot link to ZCPP3DLL (Tools.h++ version 7).
Similarly, if you are using VERSION3, you cannot link to ZCPP2DLL (the VERSION2
Standard C++ Library).
Table 17-5. DLLs Available When Using VERSION2 and VERSION3 (page 1 of 2)
VERSION 2 VERSION 3
Guardian OSS Guardian OSS
TLH7 TLH7 N.A. N.A.
CPP2 CPP2 CPP3 CPP3
CPPC CPPC
Notes:
DLL names are shown without the leading Z and these DLL; therefore, CPPC represents ZCPPCDLL, and TLH7
represents ZTLH7DLL.
OS represents the HP NonStop OS.
OSS represents the Open System Services environment.
CRTL represents the C run-time library.
CRE represents the common run-time environment.
For other environments such as the PC, the names are prefixed with lib and suffixed with .so; therefore, CPPC
is libcppc.so.