OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

1.3.4 Compilation and linkage (when using dynamic loading of service functions)

This subsection explains the procedure for compiling and linking created programs, and how to incorporate them into a UAP shared library#.

First, the main function of the UAP is compiled and linked into an executable file. Next, the UAP's service functions are incorporated into a UAP shared library#. For details on the compilation and linkage procedure, see the applicable OpenTP1 Programming Reference manual.

#
Refers to the concept of compiling UAP source files to produce UAP object files, which are then linked to create a shared library.
Organization of this subsection
(1) Compilation
(2) Linkage
(3) Creating a UAP shared library
(4) Note

(1) Compilation

The following programs must be compiled:

Use the C language compiler to compile source programs written in C, and the COBOL language compiler to compile source programs written in COBOL

(2) Linkage

The object file created by compiling the source files for the UAP main function is linked to the OpenTP1 library and other necessary files. If a non-OpenTP1 resource manager is used, the object file must be linked to the library specified by the non-OpenTP1 resource manager. To use a non-OpenTP1 resource manager with the XA interface, link the library to the UAP by performing the following steps:

  1. Specify the resource manager identifier for the non-OpenTP1 resource manager in the trnmkobj command and execute this command to create a transaction control object file.
  2. Link the object file to the UAP.

(3) Creating a UAP shared library

Incorporate the object file you created by compiling the source file for the service functions into the shared library. In the same manner as in (2) above, the source file is linked to the OpenTP1 library and other necessary files. See the TP1/Server Base sample file (make_svdl) for compilation and linkage options.

(4) Note

If the OS is HP-UX, immediate must be specified for the bind mode for linkage. If an executable file created in another bind mode is used as an OpenTP1 UAP, system operation cannot be guaranteed. To check whether the bind mode of a created UAP is immediate, use the chatr command of the OS.