0
我为一个项目启用了PCH。将所有常用标题(从C++ std lib和boost)添加到stdafx.h
,添加了stdafx.cpp
,并在其中包含stdafx.h
。我在stdafx.cpp
的属性中选择了Create
,并在项目设置中选择了Use
。此外,我还在/FI
选项中添加了stdafx.h
- 以避免在每个单元中包含stdafx.h
。Visual Studio 2017 PCH不会提高编译时间
当我重建整个项目时,它首先遵循stdafx.cpp
和快速其他*.cpp
文件 - 没关系,它似乎工作。但是,如果我更改文件然后构建项目,那么重新编译单个文件需要很多时间,与重建整个项目相比,PCH似乎不起作用,或者重建了PCH文件,或者什么?
我该怎么做?