Produce a Self-Contained Callable Shared Object for non-COBOL Applications (-y[,U][,CC])

The -y flag creates a self-contained callable shared object file from the files input to the cob command. This file can then be called by non-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 self-contained 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 self-contained 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 -y flag:

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