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

Specifying Library Files
To resolve references to external routines, Binder uses different model-dependent library files that
depend on your program’s execution environment, data model, and memory model. Table 33
shows you how to select the correct library files for your programs.
Table 33 Model-Dependent Library Files
Library FilesMemory ModelData ModelExecution Environment
CSMALLSmall16-bitGuardian module
CLARGELarge16-bitGuardian module
CWIDELarge32-bitGuardian module
CWIDE and CNONSTOPLarge32-bitGuardian module using
fault-tolerant programming
extensions
COSSLarge32-bitG-series OSS TNS module
The COSS and CWIDE library files support the 32-bit data model. Bind OSS modules with COSS
and bind Guardian modules with CWIDE. If you compile all modules in a program using the
header files supplied by HP, you can bind using either COSS or CWIDE. If you do not use header
files, you must bind using the library file that supports the module’s environment.
You can only use static binding for Guardian programs. You can use static binding or dynamic
binding for OSS programs. In static binding, the Binder resolves references to library functions by
binding the functions into the program. In dynamic binding, the Binder resolves references to library
functions using a TNS shared run-time library (SRL). Final resolution of references is performed at
run time.
A TNS shared run-time library (SRL) is a special form of a TNS user library that can contain global
variables. Programs that use an SRL cannot use a user library. HP provides TNS SRLs for OSS and
NonStop TUXEDO. You cannot build your own TNS SRLs. Do not confuse TNS SRLs with the TNS/R
native SRLs provided on D40 and later software releases. For information on native SRLs, see
Shared Run-Time Libraries (SRLs) (page 294).
To specify an SRL for an OSS TNS module compiled in the Guardian environment, do one of these:
Move the compiled object code file to the G-series OSS environment and use the OSS
environment TNS c89 utility to specify the SRL and dynamically bind the program. For example,
to specify an SRL for the object file myobject, enter:
c89 -Wbind myobject
Specify a Binder SET IMPORT command when building the program. For more details, see
the Binder Manual.
For more details, see the TNS c89 online reference page (man -M /nonnative/usr/share/man
c89). The c89 reference page in D40 and later versions of the Open System Services Shell and
Utilities Reference Manual describes the native c89 utility.
Changes in Binding CLIB
On C-series systems, the C run-time library resided in a file, CLIB, that had to be bound into each
object file that contains C functions. On systems running D-series RVUs, the TNS C run-time library
was split between two files, CLIB and CRELIB. Because CLIB and CRELIB were configured into the
system library, you do not bind them into object files.
The D20 and later C run-time libraries have significant architectural differences. Because of these
differences, D20 programs that bound in CLIB without also binding in CRELIB do not run correctly
on D30 or later releases. You must bind such programs again without CLIB or CRELIB. CLIB is no
longer released as a separate file. Check your BIND scripts to ensure that you do not bind in CLIB
or CRELIB. Look for statements such as:
266 Compiling, Binding, and Accelerating TNS C Programs