LINK Help (linkx.hlp) (Table of Contents; Topic list)
Linking with an Import Library
                                             Up Contents Index Back
─────Linking with an Import Library─────────────────────────────────────────
 
     The figure below illustrates how to create an application that
     uses a single DLL and is linked using an import library.
 
           ┌──────────┐ ┌─────────┐  ┌─────────┐ ┌──────────┐
           │ .OBJ and │ │.DEF file│  │.LIB file│ │ .OBJ and │
           │.LIB files│ │(LIBRARY)│  │(imports)│ │.LIB files│
           │          │ │(exports)│  │         │ │          │
           └────┬─────┘ └──┬─┬────┘  └────┬──┬─┘ └─────┬────┘
                └──────┬───┘ │            ↑  └──┬──────┘
                       ↓     │            │     ↓
                    (1) LINK ├(2) IMPLIB─┘  (3) LINK
                       ↓     │                  ↓
                  ┌────┴────┐│            ┌─────┴───────┐
                  │.DLL file││            │ .EXE file   │
                  │(library)├┘            │(application)│
                  └─────────┘             └─────────────┘
 
     As depicted above, linking occurs in three steps:
 
       1. Object files (and standard libraries, if any) are linked with
          a module-definition (.DEF) file to create a .DLL file. The
          .DEF file defines all functions exported by the .DLL file.
 
       2. The IMPLIB utility generates an import library (.LIB file).
          IMPLIB takes as input either the DLL generated in step 1 or
          the same module-definition file used in that step. For each
          export definition in the .DEF file, IMPLIB generates a
          corresponding import definition.
          See: IMPLIB Summary
               Import Libraries
 
       3. The .LIB file generated by IMPLIB is used as a library by
          LINK, which creates an application (.EXE) file. This .LIB
          file provides LINK with information about imported dynamic-
          link functions.
 
     See: Module-Definition Files
                                    -♦-