Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Faster Builds and Smaller Header Files

To speed the build process, Visual C++ provides the following definitions that reduce the size of the Win32 header files by excluding some of the less common APIs:



VC_EXTRALEAN defines WIN32_LEAN_AND_MEAN and a number of NOservice definitions, such as NOCOMM and NOSOUND. (For a list of NOservice definitions, see the header file Windows.h and the MFC header file afxv_w32.h.)

Applications created with the Visual C++ application wizards use VC_EXTRALEAN automatically. You can manually define VC_EXTRALEAN in legacy MFC applications to speed their build process.

Non-MFC applications can define WIN32_LEAN_AND_MEAN and applicable NOservice definitions to reduce build times.

Trying to use an API excluded by these definitions causes compiler errors. If a program that defines NOCOMM or VC_EXTRALEAN tries to use PurgeComm, for example, the following errors result:

error C2065: 'PurgeComm' : undeclared identifier
error C2064: term does not evaluate to a function

Fore more information, see http://support.microsoft.com/default.aspx?scid=kb;en-us;166474.

Community Additions

© 2015 Microsoft