GUI ScreenIO for Windows

 ScreenIO.com


LIB: Object Library Maintenance 

Now that you've decided it makes sense to use object libraries, how do you go about creating and maintaining your own? Easy; you use Microsoft LIB.

Microsoft LIB is a program that is distributed with your compiler. Unfortunately, however, compiler vendors rarely provide much, if any, documentation on actually using LIB. Fortunately, LIB is easy to use.

You can get a list of instructions by giving the command "LIB /h" at your command prompt. That yields this somewhat terse output, but it's all we really need:

Microsoft (R) Library Manager Version 5.12.8181
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

usage: LIB [options] [files]

options:

/CONVERT
/DEBUGTYPE:CV
/DEF[:filename]
/EXPORT:symbol
/EXTRACT:membername
/INCLUDE:symbol
/LIBPATH:dir
/LIST[:filename]
/MACHINE:{ALPHA|ARM|IX86|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4}
/NAME:filename
/NODEFAULTLIB[:library]
/NOLOGO
/OUT:filename
/REMOVE:membername
/SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}[,#[.##]]
/VERBOSE

Creating a new object library

You must create the library before you can use it. You can't create an empty library, so you need to add a module to it when you create it.

In this example, we'll create the object library my.lib and store the object module a.obj in it. 

LIB /out:my.lib a.obj

Simple, no? 

Adding or updating a module in an existing object library

Now that we've created the library, it's trivial to update it. Let's add our object module b.obj to my.lib:

LIB my.lib b.obj

If b.obj was already present in my.lib, this will replace the original b.obj with the new one.

The rest of the commands are about as simple, but they're rarely used.

Related topics:


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom