Share via


NOT_LEAN_AND_MEAN

The NOT_LEAN_AND_MEAN macro causes the Build utility to use a much greater number of header files.

Generally, Visual Studio compilations use the windows.h file. This file tests to see whether a variable named WIN32_LEAN_AND_MEAN is defined. When WIN32_LEAN_AND_MEAN is defined, a large number of header files are deliberately excluded by Windows.h; only the actual Windows headers are used. The equivalent Build utility procedure is to leave the NOT_LEAN_AND_MEAN macro undefined (or equal to zero). This is the default setting of the Build utility.

If the WIN32_LEAN_AND_MEAN variable is undefined in a Visual Studio build, or if NOT_LEAN_AND_MEAN=1 in a Build utility build, all header files are used. This is a much larger compilation -- in addition to the Windows headers, it includes the OLE, RPC, and network headers. This is the default setting for Visual Studio.

If you want to emulate the default Visual Studio behavior, define the following in your Sources file:

NOT_LEAN_AND_MEAN=1

The best practice is to review your code and remove unnecessary header files. However, this is sometimes a much more difficult process.

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011