Using Object librarian

To run the object librarian, enter the following command lineat a command prompt:

sblib [-n] [-msOMF] [-msCOFF] [-ELF] Library {[Commands] filename}[,listfile]

n is the maximum size of the library in megabytes.  It must be 1, 2, 4, or 8. The default is 4. This is only applicable for OMF libraries.

msOMF designates that the object library to be created is anOMF library. The output file will be an OMF object library and all inputs must beOMF objects or libraries.

msCOFF designates that the object library to be created is aCOFF archive.  The output file will be a COFF archive and all inputs must beCOFF objects or archives. msCOFF is the default on Win32 hosted systems.

ELF designates that the object library to be created is a ELFarchive.  The output file will be a ELF archive and all inputs must be ELF objectsor archives. ELF is the default on Linux and SunOS/Solaris hosted systems.

Library is the name of the object library.  If thelibrary exists, the commands modify the existing library.  If the library doesnot exist, a new library is created.

Commands is any combination of:

filename is the name of an object file or object library. The default extension for filename is '.obj', so you need to specify '.lib'for library files.  You can include any number of object or library files, separatingthe names by spaces.

listname is the name of an optional listing file.  Whenyou specify a listing file, the object librarian creates a listing of all of theobject modules in the library, and all of the public symbols contained in those modules.

EXAMPLE: Object librarian commands

To create a library from the objects of unit1 and unit2, usethe following command:

sblib unitlib unit1 unit2

sblib creates a library named unitlib.lib and inserts the modulesunit1.obj and unit2.obj.

To add all of the modules in another library to an existing library,use:

sblib unitlib lib1.lib

Assuming unitlib.lib already exists, the modules in lib1.libare added to it.  Note that you need the '.lib' extension, or '.obj' would beassumed.

To replace a module in a library, use:

sblib unitlib -+unit1

This command first deletes the object module UNIT1 from the libraryUNITLIB.LIB, then inserts it.

To extract an object module from a library, creating an objectfile, use:

sblib unitlib *unit1, unitlib.lst

Sblib extracts the module unit1 from the library unitlib.lib,creating the object file unit1.obj, and also creates a listing of all of the objectmodules in the library and all of the public symbols contained in those modules.

Using a response file

You can also specify the files for the librarian in a responsefile.  A response file is like a batch file, and it contains the same parametersas the SBLIB command line.  

Use this command with a response file:

sblib @ResponseFileName


ResponseFileName is the name of the response file.  Thedefault extension '.lbr' is used if you do not specify a file extension.

Each parameter in the response file must have its own line.  Ifa line must be continued, place an & (ampersand) at the end of the line to indicatecontinuation.

Note: When you use a response file, a new library is alwayscreated.  It does not alter an existing library.

EXAMPLE: Response file

For example, the following response file creates a library calledunit.lib from the libraries unit1.lib, unit2.lib and unit3.lib.  

unitlib.lib is the optional listing file.

unitlib unit1.lib &
unit2.lib &