Produce a Callable Shared Object for COBOL Applications (-z[,U][,CC])

The -z flag creates a callable shared object file from the files input to the cob command. This file can then be called by COBOL executables.

Input files can be any file type except .gnt files. If you use object module files (.o), they are linked in using the system linker (ld).

The ,CC option enables you to also link C++ objects into the library file. If C++ ( .C) source files are specified, the C++ compiler is invoked to compile them to object code first.

The source code files are compiled into intermediate code, generated to object code (.o) files, and then linked to create a dynamically loadable callable shared object.

By default, the base-name of the resulting shared object file takes the name of the first object being linked, and has the filename extension .so. The base-name forms the main entry point, but this can be overridden using the -e flag.

The ,U option specifies that an error message should be issued if there are any undefined symbols.

If the -g flag is also specified, the resulting callable shared object contains debugging information so that it can be debugged with Animator.


The following examples illustrate the types of processing available using the -z flag:

cob Command line Output files
cob -z tmp/a.cbl, a.idy, a.o,
cob -z b.cbl, b.idy, b.o,
cob -z 
cob -z c.o
cob -zg a.cbl, a.idy, a.o,
cob -z,CC cobprg.cbl cprg.C, cobprg.idy, cobprg.o, cprg.o,