Using shared libraries

Shared libraries provide a convenient and efficient means of packaging applications, and are widely used in Linux®.

About this task

In COBOL, a shared library is a collection of one or more outermost programs. Just as you can compile and link several COBOL programs into a single executable file, you can link one or more compiled outermost COBOL programs to create a shared library. You typically use a shared library as a collection of frequently called functions.

Although the outermost programs in a shared library can contain nested programs, programs external to a shared library can call only the outermost programs (known as entry points) in the shared library. Each program in a shared library is referred to as a subprogram.

You can call COBOL shared libraries or a mixture of COBOL and C/C++ shared libraries.

Example: creating a sample shared library