LINK Help (linkx.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Module-Definition Files
 Example                                   Up Contents Index Back
─────Module-Definition Files────────────────────────────────────────────────
 
     A module-definition file describes the names, attributes, exports,
     imports, and other characteristics of an application or DLL.
     Module-definition files are required for DLLs and are optional
     (but desirable) for OS/2 and Windows applications. By convention,
     filenames of module-definition files have the extension .DEF.
 
     Each file contains one or more statements.
     See: Module Statements
 
     Syntax Rules
 
     The following rules of syntax apply to all statements:
 
        ■ Statement and attribute keywords are not case sensitive. A
          statement keyword can be preceded by spaces and tabs.
 
        ■ A NAME or a LIBRARY statement, if used, must precede all
          other statements.
 
        ■ Most statements appear at most once in a file and accept one
          specification of parameters and attributes. These follow the
          statement keyword on the same or subsequent line(s). If
          repeated with a different specification later in the file,
          the later statement overrides the earlier one.
 
        ■ The SEGMENTS, EXPORTS, and IMPORTS statements can appear more
          than once in the file and can take multiple specifications,
          each on its own line. The statement keyword must appear once
          before the first specification and optionally can be repeated
          before each additional specification.
 
        ■ Comments in the file are designated by a semicolon (;) at the
          beginning of each comment line. A comment cannot share a line
          with part or all of a statement but can appear between lines
          of a multiline statement.
 
        ■ Numeric arguments can be specified in decimal format or
          C-language notation.
          See: Entering Numeric Arguments
 
        ■ Name arguments cannot match a reserved word.
          See: Reserved Words
 
     When to Use a Module-Definition File
 
     A module-definition file links a DLL to an OS/2 or Windows
     application. To link to a DLL, either
 
        ■ Specify in LINK's <deffile> field a module-definition file
          describing the DLL, or
 
        ■ Specify in LINK's <libraries> field an import library for the
          DLL. To create an import library, run the IMPLIB utility with
          either the DLL or the module-definition file used to create
          the DLL.
 
     See: Dynamic-Link Libraries
          IMPLIB Summary
          Import Libraries
          Linking for OS/2 and Windows
          Linking without an Import Library
          Linking with an Import Library
                                    -♦-