VisualStudio 项目上的 ipch 文件

我在我的项目中找到了一个 ipch 文件夹,它的文件有一个 ipch 扩展名。而且,它们非常庞大。

我能摆脱他们吗?

65278 次浏览

That is the precompiled headers file that is used by the IntelliSense parser. Distinct from the precompiled header file that the compiler generates when you build your project, that's a .pch file in your build output directory. It otherwise plays the exact same role, it greatly increases the speed of the parser. It can use that kind of help, the EDG front-end has never been particularly fast.

Deleting them is fine, they are only used when you have the project loaded in the IDE. If you reload the project then IntelliSense is going to be catatonic for a while, rebuilding the .ipch file, re-parsing the files in the project and recreating the .sdf file in the project directory. On large projects that can easily take a handful of minutes. Of course, the bigger the .ipch file, the longer that will take. It is something you'd normally only contemplate after you finished a project.

You can't change location of ipch file on persolution basis, but you can do it for whole VS installation. For this you need to change Always Use Fallback Location in Tools>Options to true. After this you can delete ipch folder from your solution's folder and it will not appear there again.

enter image description here

You can read a bit more here