Creating module definition files
A
module definition file contains one or more module statements. Use these
statements to define attributes of your executable output file and of code and
data segments in the file, and to identify data and functions that are imported
into or exported from the file.
If you provide a .LIB file but not a module definition file, cob2
creates the .DEF file. Otherwise, to link a DLL, you must provide to cob2
a .DEF file. cob2 will then generate an .IMP file and an .EXP file.
You
can use module definition files when:
- You create a DLL.
- You need to define attributes of the executable output file more precisely
than you can with options alone. For example, to define library
initialization and termination behavior, use the LIBRARY statement.
- You need to define segment attributes more precisely than you can with
options alone.
When you create a module
definition file:
- Use a NAME or LIBRARY statement to define the type of
executable output you want. You can use only one of these statements, and it
must precede all other statements in the module definition file.
- Begin comments with a semicolon (;). The linker ignores lines in
the file that begin with a semicolon, and any portion of a line that follows
a semicolon.
- Enter all module definition keywords (such as NAME, LIBRARY,
and IOPL) in uppercase letters.
- Do not a reserved word as a text parameter to a statement. For example,
you cannot use the LIBRARY statement to name a library SHARED,
because SHARED is a keyword.
related references
Reserved words for module statements
Summary of module statements
|