The -Y flag creates a shared library file from the files input to the cob command. This file can then be linked to non-COBOL executables.
Input files can be any file type except .gnt files.
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.
By default, the base-name of the resulting shared library file takes the name of the first object being linked, prefixed with lib, and the filename extension is .so.
For example, the following command line links the C++ program cprg.C and the COBOL program cobprg.cbl into the resulting shared library libcobprg.so:
cob -Y,CC cobprg.cbl cprg.C