To build an import library and export file, use the following syntax:
When /DEF is specified, LIB creates the output files from export specifications that are passed in the LIB command. There are three methods for specifying exports, listed in recommended order of use:
These are the same methods you use to specify exports when linking an exporting program. A program can use more than one method. You can specify parts of the LIB command (such as multiple objfiles or /EXPORT specifications) in a command file in the LIB command, just as you can in a LINK command.
The following options apply to building an import library and export file:
This option sets the format of debugging information. Specify CV for new-style Microsoft Symbolic Debugging Information, required by Visual C++ and Visual Fortran. Specify COFF for Common Object File Format (COFF) debugging information. Specify BOTH for both COFF debugging information and old-style Microsoft debugging information.
This option overrides the default output filename for the import library being created. When /OUT is not specified, the default name is the base name of the first object file or library in the LIB command and the extension .LIB. The exports file is given the same base name as the import library and the extension .EXP.
This option exports a function from your program to allow other programs to call the function. You can also export data. Exports are usually defined in a DLL.
The entryname is the name of the function or data item as it is to be used by the calling program. You can optionally specify the internalname as the function known in the defining program; by default, internalname is the same as entryname. The ordinal specifies an index into the exports table in the range 1 - 65535; if you do not specify ordinal, LIB assigns one. The NONAME keyword exports the function only as an ordinal, without an entryname.
This option adds the specified symbol to the symbol table. This is useful for forcing the use of a library object that otherwise would not be included.