DCE Application Programming Guide

HP NonStop DCE Application Programming Guide429551-003
4-1
4
Building, Running, and Debugging
NonStop DCE Applications
This section describes:
Building NonStop DCE Programs
Running NonStop DCE Programs on page 4-3
Debugging NonStop DCE Programs on page 4-6
Building NonStop DCE Programs
NonStop DCE applications are compiled and either bound or linked using an OSS c89
utility. The compiler and linker options you use differ according to whether you are
building.
A TNS application (G-series systems only; H-series systems do not support TNS
execution)
A TNS/R native application consisting of position-independent code (PIC)
A TNS/R native application consisting of non-PIC
A TNS/E native application
In each case, a different make file content is required.
To create an executable TNS program, link the program with the NonStop DCE TNS
shared run-time library, using the c89 utility -ldce flag. For example, to create a
program called my_server from the C source file my_server.c, enter:
/nonnative/bin/c89 -o my_server my_server.c -L /usr/lib -l dce
This example assumes that the application runs using a TNS version of a
NonStop DCE virtual host. For more information about the TNS version of the C
compiler, see the online c89(1) reference page using:
man -M /nonnative/user/share/man c89
To create an executable TNS/R or TNS/E native program, all data structures must be
shared2 aligned. For a TNS/R native program, the TNS/R shared run-time library
(SRL) must be used. For a TNS/E native program, the TNS/E dynamic-link library
(DLL) must be used.
For example, to create and link a TNS/R native non-PIC program called my_server
from the C source file my_server.c and use the SRL located at
$SYSTEM.ZDCE.LDCE, enter:
/usr/bin/c89 -o my_server my_server.c -Wextensions
-Wfieldalign=shared2
-Wnld="-set libname \$system.zdce.ldce"