Udostępnij za pośrednictwem


How Can I Build Faster?

This topic contains tips for reducing the amount of time it takes to build a project.

  • Reduce the number of header files Visual C++ must include and check for every build.

  • Use precompiled headers. See /Y (Precompiled Headers) for more information.

  • When calling cl.exe directly, do not invoke the compiler once for every source file; pass all source files to cl.exe in the same invocation to create .obj files.

  • Use minimal rebuild; see /Gm for more information.

  • Use incremental linking; see /INCREMENTAL for more information.

  • Use #pragma once, when appropriate. For example, if your headers use include guards.

  • Dynamically link to the CRT; see /MD for more information.

  • Use multiple processes to build; see /MP for more information.

Additional topics include:

See Also

Reference

Frequently Asked Questions on Building

Creating Precompiled Header Files