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

Libraries and Utility Routines
HP COBOL Manual for TNS/E Programs520347-003
13-12
Specifying a DLL
ELD 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 13-10 compiles the source file MAIN and links the resulting
object file with the DLL named MYDLL, creating a loadfile named MAINO.
Guardian Environment: Compile and Link in Two Steps
1. Compile the program that uses the DLL with these directives:
CALL-SHARED
CONSULT with the name of the DLL as an object-name (see CONSULT
and NOCONSULT)
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 13-11, 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.
Example 13-10. 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)
Example 13-11. Specifying a DLL When You Compile and Then Link (Guardian)
ECOBOL /IN MAIN/ MAINO; CALL-SHARED; CONSULT MYDLL
ELD MAINO -CALL_SHARED -L $VOL.SUBVOL -l MYDLL -optional_lib
-l ZCOBDLL -l ZCREDLL -O MYPROG