Previous Topic Next topic Print topic


cbllink Examples

Use the cbllink command to link .obj files, or to compile and link source code files in one step.

To Produce a System Executable File

To compile and link the file myprog.cbl to produce an .exe file, myprog.exe, use the command:

cbllink myprog.cbl
To Produce a Dynamic Link Library File

To compile and link the file mydll.cbl to produce a .dll file, mydll.dll, use the command:

cbllink -d mydll.cbl
To Create a Standalone Executable File

The following command compiles and the files main.cbl, module1.cbl, module2.cbl and any run-time support modules that are needed to create the graphical main.exe:

cbllink -g -b main.cbl module1.cbl module2.cbl

The following command compiles and statically links the files main.cbl, module1.cbl, and any run-time support modules that are needed to create the character-based standalone executable myapp.exe:

cbllink -b -omyapp.exe main.cbl module1.cbl
To Create a Modular Application

The following commands:

  • Compile and statically link the files main.cbl and unique1.cbl, to create the root module of the graphical application main.exe.
  • Llink the run-time support module Mffh to create a dynamic link library, mffh.dll.
cbllink -g -s main.cbl unique1.cbl 
cbllink -d mffh

The following commands:

  • Compile and statically link the files main.cbl and unique1.cbl, to create the root module of the character-based application myapp.exe.
  • Link the run-time support modules Adis, Adisinit and Adiskey to create a dynamic link library, adis.dll.
cbllink -s -omyapp.exe main.cbl unique1.cbl
cbllink -d adis adisinit adiskey
To Create a Dynamically Linked Application

To create an application in which the files main.cbl and fast1.cbl are compiled and linked to create the root module of the graphical application myapp.exe, use the command:

cbllink -g -s -omyapp.exe main.cbl fast1.cbl

To create an application in which the files subprog1.cbl and subprog2.cbl are compiled and linked to create a dynamic link library, subprogs.dll, use the command:

cbllink -d -s -osubprogs.dll subprog2.cbl subprog3.cbl
To Create a Dynamically Bound Application

To create a .dll file that can bind to the run-time system, and any version later than or including that supplied with this COBOL development system, use the command:

cbllink -d -r mydll.obj

To create a .dll file that must bind to the version of the run-time system supplied with this COBOL development system, use the command:

cbllink -d -rv mydll.obj
Previous Topic Next topic Print topic