Various command-line options can be used to control LIB.
To run LIB, type the command lib
followed by the options and filenames for the task you are using LIB to perform. LIB also accepts command-line input in command files, which are described in the following section. LIB does not use an environment variable.
Note If you are accustomed to the LINK32.EXE and LIB32.EXE tools provided with the Microsoft Win32 Software Development Kit for Windows NT, you may have been using either the command link32 -lib
or the command lib32
for managing libraries and creating import libraries. Be sure to change your makefiles and batch files to use the lib
command instead.
You can pass command-line arguments to LIB in a command file by using the following syntax:
LIB @commandfile
The file commandfile is a text file. No space or tab is allowed between the at sign (@) and the filename. There is no default extension; you must specify the full filename, including any extension. Wildcards cannot be used. You can specify an absolute or relative path with the filename.
In the command file, arguments can be separated by spaces or tabs, as they can on the command line; they can also be separated by newline characters. Use a semicolon (;) to mark a comment. LIB ignores all text from the semicolon to the end of the line.
You can specify either all or part of the command line in a command file, and you can use more than one command file in a LIB command. LIB accepts the command-file input as if it were specified in that location on the command line. Command files cannot be nested. LIB echoes the contents of command files unless the /NOLOGO option is used.
An option consists of an option specifier, which is either a dash ( – ) or a forward slash ( / ), followed by the name of the option. Option names cannot be abbreviated. Some options take an argument, specified after a colon (:). No spaces or tabs are allowed within an option specification. Use one or more spaces or tabs to separate option specifications on the command line. Option names and their keyword or filename arguments are not case sensitive, but identifiers used as arguments are case sensitive. LIB processes options in the order specified on the command line and in command files. If an option is repeated with different arguments, the last one to be processed takes precedence.
The following options apply to all modes of LIB:
/MACHINE:{IX86|ALPHA|ARM|MIPS|MIPSR41XX|PPC|SH3|SH4}
Specifies the target platform for the program. Usually, you do not need to specify /MACHINE. LIB infers the machine type from the .OBJ files. However, in some circumstances, LIB cannot determine the machine type and issues an error message. If such an error occurs, specify /MACHINE. In /EXTRACT mode, this option is for verification only.
/NOLOGO
Suppresses display of the LIB copyright message and version number and prevents echoing of command files.
/VERBOSE
Displays details about the progress of the session. The information is sent to standard output and can be redirected to a file.
Other options apply only to specific modes of LIB. These options are discussed in the sections describing each mode.