How to use precompiled headers efficiently (using /Yc and Yu options)?

前端 未结 2 1097
别那么骄傲
别那么骄傲 2021-02-02 03:05

We are using Visual Studio 2003 (VC71) for compilation. In order to reduce the compile time we changed the build script such that it generates the precompiled header (.pch) file

2条回答
  •  既然无缘
    2021-02-02 03:37

    /Yc should only be used on one of your .cpp modules. This specifies to VS to create the precompiled header with that module.

    For all others in your project, use /Yu. This specifies that they are to simply use the pch.

    The MSDN entry for it is here: http://msdn.microsoft.com/en-us/library/szfdksca(v=VS.71).aspx

提交回复
热议问题