OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P

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

5.2.1 Compiling and linking in a UNIX environment

Organization of this subsection
(1) Compile
(2) Link

(1) Compile

To create a CUP object file in COBOL, compile the source program using the COBOL compiler. For details of the compilation, see the manual OpenTP1 Programming Reference COBOL Language. The following shows how to enter commands for compiling the source program using COBOL85.

Example:
UAP source programs in COBOL
  • cupmain.cbl (main program)
  • cupfnc1.cbl (sub-program 1)
  • cupfnc2.cbl (sub-program 2)
These source programs are compiled as follows.
 
ccbl -C2 -Mw cupmain.cbl
ccbl -C2 cupfncl.cbl
ccbl -C2 cupfnc2.cbl
 
Executing the ccbl command generates the following object files.
  • cupmain.o (object file for the main program)
  • cupfnc1.o (object file for the sub-program 1)
  • cupfnc2.o (object file for the sub-program 2)

(2) Link

To create an executable file for CUP, link the following files.

The following shows how to enter commands for linking these files using COBOL85.

Example:
To create a COBOL CUP executable file "example", link these object files as shown below.
  • Object file for the main program
    cupmain.o
  • Object files for the sub-programs
    cupfnc1.o, cupfnc2.o
 
ccbl -o example cupmain.o cupfnc1.o cupfnc2.o
     -L/usr/lib -lclt
 

Note
The -L option is omissible.