C/C++ Programmer's Guide (G06.25+)
Compiling, Binding, and Accelerating TNS C
Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
14-15
Binding an OSS TNS Module
Binding an OSS TNS Module
By default, the TNS c89 utility performs dynamic binding. 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) on page 16-13.
TNS c89 uses the SRL libc.so in the OSS file system by default. libc.so is
equivalent to the libraries libc.a and libm.a in a UNIX environment and COSS in
the Guardian environment.
Dynamic binding produces smaller program files and uses fewer system resources
than static binding.
You can also perform static binding for OSS programs. In static binding, the Binder
resolves references to library functions by binding the functions into the program. Static
libraries can be used for dynamic binding. The Binder resolves external references
using all the specified static libraries before using the SRL.
Binding Considerations
•
To bind a Guardian program with the TNS c89 utility, specify the libgwc.a library.
libgwc.a is equivalent to the Guardian file CWIDE. The -Wsystype=guardian
flag sets the default library to libgwc.a.
Define a preprocessor
symbol
-D name Specify the #define
preprocessor directive in the
source file or use the C
compiler command line
define option
Undefine a preprocessor
symbol
-U name Specify the #undef
preprocessor directive or use
the C compiler command line
undefine option
Change the search algorithm
for header files
-I directory Specify the SSV pragma
Change the search algorithm
for library files
-L directory Similar to specifying the
SEARCH pragma
Table 14-6. Commonly Used TNS c89 Flags and Guardian Environment
Equivalents (page 2 of 2)
To direct c89 to: Specify this flag:
Equivalent Guardian
environment action