Compile and link the COBOL Web application as explained below. When the COBOL Project Manager is used, use the Build utility to perform compilation and linkage.
Compilation of COBOL source programs
COBOL source programs can be specifically compiled by either of two methods: (1) Execute the WINCOB command and operate the window, or (2) Enter the compile command after the command prompt. The following example explains compilation using the compile command.
COBOL32 -M MAIN-PROGRAM.COB
COBOL32 INITIAL-PROGRAM.COB
COBOL32 BUSINESS-PROGRAM.COB
COBOL32 END-PROGRAM.COB
For details of compilation using the WINCOB command and for details of compilation commands, refer to the NetCOBOL User's Guide.
Linkage of COBOL object programs
Object programs which are created by compiling COBOL source programs can be linked with each other by either of two methods: (1) Execute the WINLINK command and operate the window, or (2) Enter the link command after the command prompt. The following example explains linkage using the link command.
For details of linkage using the WINLINK command and for details of link commands, refer to the NetCOBOL Use's Guide.
Creation (static linkage) of two or more object files into one execution-format file (.EXE file)
LINK MAIN-PROGRAM.OBJ INITIAL-PROGRAM.OBJ BUSINESS-PROGRAM.OBJ END-PROGRAM.OBJ F3BICIMP.LIB MSVCRT.LIB F3BICWSR.LIB /OUT:EXECUTION-FORMAT-NAME.EXE
Creation (dynamic linkage) of two or more object files into one execution-format file (.EXE) and two or more dynamic link libraries (.DLL)
LINK INITIAL-PROGRAM.OBJ F3BICIMP.LIB MSVCRT.LIB /DLL /OUT:INITIAL-PROGRAM.DLL
LINK BUSINESS-PROGRAM.OBJ F3BICIMP.LIB MSVCRT.LIB F3BICWSR.LIB /DLL /OUT:BUSINESS-PROGRAM.DLL
LINK END-PROGRAM.OBJ F3BICIMP.LIB MSVCRT.LIB /DLL /OUT:END-PROGRAM.DLL
LINK MAIN-PROGRAM.OBJ INITIAL-PROGRAM.LIB BUSINESS-PROGRAM.LIB END-PROGRAM.LIB F3BICIMP.LIB MSVCRT.LIB /OUT:EXECUTION-FORMAT-NAME.EXE
For details of linkage using the WINLINK command and for details of link commands, refer to the NetCOBOL User's Guide.
Note
The CGI subroutines do not have backward compatibility. Therefore, libraries (COBW3.cbl) whose version or level is later than that of the CGI subroutines to be used cannot be used. CGI subroutines whose version or level is earlier than that of the libraries that were copied into Web applications must not be linked.