Partager via


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

  • WIN32_LEAN_AND_MEAN

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 https://support.microsoft.com/default.aspx?scid=kb;en-us;166474.

See Also

Reference

How Can I Build Faster?