PRB: U1150 Error From the LIB Utility (120193)



The information in this article applies to:

  • The Microsoft Library Manager (LIB.EXE), when used with:
    • Microsoft Visual C++ 1.0
    • Microsoft Visual C++ 1.5

This article was previously published under Q120193

SYMPTOMS

When you build a Static Library (.LIB) from the Visual Workbench, the following error message may be returned:
LIB Fatal Error U1150
page size too small; use option /PAGE:n to increase it
There is no way to modify the "LIB" command line within the Visual Workbench.

RESOLUTION

There is a relatively simple workaround for this problem. All you need to do is find the inference rule within the makefile generated by Visual Workbench that causes the LIB utility to be run. There, you can change the command line that is passed to the LIB utility. To do this, open the makefile in a text editor and search for the $(PROJ).LIB: inference rule. When that inference rule is evaluated, it creates a LIB response file called "$(PROJ).CRF", which contains the command-line switches as well as the responses for the LIB utility's prompts. The /PAGESIZE option is set to 64, and it can be found somewhere between the pair of "<<" symbols. All that needs to be done is to change that default value from 64 to a power of 2 that is greater than 64 and is less than or equal to 32768 (such as 128, 256, 512, 1024, 2048, 4096, and so forth).

NOTE: /PAGESIZE:64 is the hard-coded default used by the Visual Workbench when building a static library.

There is one important caveat here, however: When you use the internal build engine of the Visual Workbench, the inference rule portion of the makefile is not used. Instead, the Visual Workbench uses the inference rules only when the file is opened as an external makefile. For this solution to work, the makefile must be opened as an external makefile in the Visual Workbench or the library must be built with NMAKE from the command line.

MORE INFORMATION

The page size of a library sets the alignment of modules stored in the library. Modules start at locations that are a multiple of the page size from the beginning of the file. When the page size is too small, the U1150 error occurs.

REFERENCES

For further information, see the documentation for the LIB utility, located in the LIB.WRI file in the MSVC\HELP directory.

Modification Type:MajorLast Reviewed:11/17/2003
Keywords:kb16bitonly kbprb KB120193