/Zl (Remove Default-Library Name from Object File)

Ordinarily, CL puts the name of the default library (mLIBCE.LIB) in the object file so the linker can automatically find the correct library to link with the object file.

The /Zl option tells the compiler not to place the default-library name in the object file. As a result, the object file is slightly smaller. The option affects all files that follow it on the command line.

Use the /Zl option when you are using the LIB utility (described in Chapter 19) to build a library. You can use /Zl to compile the object files you plan to put in your library, thereby omitting the default-library names from your object modules. Although the /Zl option saves only a small amount of space for a single object file, the total amount of space saved is significant in a library containing many object modules.

Example

CL ONE.C /Zl TWO.C

This example creates the following two object files:

An object file named ONE.OBJ that contains the name of the C library SLIBCE.LIB

An object file named TWO.OBJ that contains no default-library information

When ONE.OBJ and TWO.OBJ are linked, the default-library information in ONE.OBJ causes the default library to be searched for any unresolved references in either ONE.OBJ or TWO.OBJ.