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

Table Of Contents
Compiling, Binding, and Accelerating TNS C
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
14-16
Examples of Working in the OSS Environment
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.
You cannot use an SRL for Guardian programs. Only OSS programs can use an
SRL.
You must bind internationalized programs using an SRL that supports
internationalization. For more details on binding internationalized programs, see
the Software Internationalization Manual.
Examples of Working in the OSS Environment
These examples show you how to use the TNS c89 utility to compile, bind, and
accelerate programs in the OSS environment.
1. In this example, c89 compiles source file test1.c and binds the object file into
program file a.out. The default shared run-time library libc.so is used to
resolve external references with dynamic binding:
c89 test1.c
2. In this example, c89 compiles source file test2.c into object file test2.o:
c89 -c test2.c
3. In this example, c89 compiles source file test3.c, binds the resultant object file,
and accelerates the program file into an accelerated program file a.out. Binder
uses the default shared run-time library libc.so to resolve external references,
and the compiler generates a symbols region for symbolic debugging:
c89 -g -O test3.c
4. In this example, c89 invokes the SQL compiler for the object file test4.o:
c89 -Wsql test4.o
5. In this example, c89 compiles source file test5.c and binds the object file into
program file testprog. Binder uses the library libmine.a to resolve external
references before the library libc.a. Because libmine.a and libc.a are not
shared run-time libraries, static binding is performed:
c89 -o testprog -l mine -l c test5.c