COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

PC Environment: Compile and Link in One Step
PC Environment: Compile and Link in Two Steps
Guardian Environment: Compile and Link in One Step
Compile the program that uses the DLL with these directives:
CALL-SHARED (page 540) (default)
CONSULT with the name of the DLL as an object-name (see CONSULT and NOCONSULT
(page 544))
ELD (page 548) with these options:
-L (which is similar to the ecobol option -L)
-l or -lib (which is similar to the ecobol option -l)
For more information about the eld options -l or -lib, see the eld Manual.
The result is a loadfile.
The command in Example 172 compiles the source file MAIN and links the resulting object file
with the DLL named MYDLL, creating a loadfile named MAINO.
Example 172 Specifying a DLL When the Compiler Calls the Linker (Guardian)
ECOBOL /IN MAIN/ MAINO; CALL-SHARED; CONSULT MYDLL; RUNNABLE;&
&ELD(-L $VOL.SUBVOL -l MYDLL)
Guardian Environment: Compile and Link in Two Steps
1. Compile the program that uses the DLL with these directives:
CALL-SHARED (page 540)
CONSULT with the name of the DLL as an object-name (see CONSULT and
NOCONSULT (page 544))
The result is a linkfile.
2. Link the linkfile, using the eld utility with these eld options:
-L (which is similar to the ecobol option -L)
-l or -lib (which is similar to the ecobol option -l)
-optional_lib -l ZCOBDLL -l ZCREDLL, which links your file with the DLLs named
ZCOBDLL and ZCREDLL
For more information about the eld options -l or -lib, see the eld Manual.
In Example 173, the first command compiles the source file MAIN, specifying the DLL named
MYDLL and creating the linkable object file MAINO. The second command links MAINO with
MYDLL and the DLLs named ZCOBDLL and ZCREDLL, creating a loadfile named MYPROG.
Dynamic-Link Libraries (DLLs) 607