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

-L, where directory is the name of the directory of libraries
-l, where library is the name of the DLL
NOTE: Do not use -c.
The result is a loadfile.
The command in Example 176 compiles the source file main.cob and links the resulting object
file with the DLLs named ZCOBDLL and ZCREDLL and the DLL named mydll, creating the loadfile
main.exe. MYDLL is in dll-location. (An example of dll-location is C:\xxx\yyy.)
Example 176 Specifying a DLL When the Compiler Calls the Linker (PC)
ecobol main.cob -Wcall_shared -Wcobol="CONSULT MYDLL" -L dll-location
-l mydll -optional_lib -L lib-directory -l ZCOBDLL -l ZCREDLL
-o main.exe
PC Environment: Compile and Link in Two Steps
1. Compile the program that uses the DLL with these options:
-Wcall_shared
-c
-Wcobol, with the argument “CONSULT MYDLL
The result is a linkfile.
2. Link the linkfile, using the eld utility with these eld options:
-l or -lib (which is similar to the ecobol option -l), where library is the name of
the DLL
-optional_lib followed by:
-L lib-directory -lcob, which links your file with the DLL named ZCOBDLL
-obey lib-directory\libc.obey, which links your file with the DLL named
ZCREDLL
lib-directory is the name of the directory of libraries.
For more information about the eld options -l or -lib, see the eld Manual.
In Example 177, the first command compiles the source file main.cob, specifying the DLL named
MYDLL and creating the linkable object file main.o. The second command links main.o with
mydll and the DLLs named ZCOBDLL and ZCREDLL, creating the loadfile main.exe. MYDLL is
in dll-location. (An example of dll-location is C:\xxx\yyy.)
Example 177 Specifying a DLL When You Compile and Then Link (PC)
ecobol main.cob -Wcall_shared -c -Wcobol="CONSULT MYDLL"
ld main.o -call_shared -L dll-location -l mydll -optional_lib
-L lib-directory -lcob -obey lib-directory\libc.obey -o main.exe
Files of Dummy Routines
Files of dummy routines enable the compiler to accept ENTER statements that are to be resolved
at program load time rather than by the linker.
Files of Dummy Routines 609