The simplest way to call a C program from ACUCOBOL-GT is to:
- Package the routine into a Windows DLL or UNIX/Linux shared object library.
- Load the DLL or shared object at startup by using one of the following options:
- Use the "-y" runtime option
- Use the SHARED_LIBRARY_LIST runtime configuration variable
- Load the DLL or shared object during program execution with a CALL statement or via the SHARED_LIBRARY_LIST variable and a
SET ENVIRONMENT statement.
- Call the routine with a CALL statement.
For a detailed description of using this method with DLLs, see
Calling DLLs from COBOL.
This section contains detailed information on calling routines in UNIX/Linux shared objects. An important advantage of this
method is that it is not necessary to relink the runtime.
In this section, we describe the following methods of loading and calling programs in shared object libraries:
- Loading libraries with the "-y" runtime option
- Loading libraries with the SHARED_LIBRARY_LIST configuration variable
- Loading libraries with the CALL statement
- Calling routines with the CALL statement
Once loaded, any exported function can be called with a COBOL CALL statement.