C++ Visual Studio 项目中的 ipch 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19398287/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:46:37  来源:igfitidea点击:

ipch files on a Visual Studio project

c++visual-studio-2010

提问by MelMed

I am finding an ipch folder in my project whose files are having an ipch extension. Plus, they are quite voluminous.

我在我的项目中找到一个 ipch 文件夹,其文件具有 ipch 扩展名。另外,它们非常庞大。

Can I get rid of them?

我能摆脱它们吗?

回答by Hans Passant

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.

这是 IntelliSense 解析器使用的预编译头文件。与编译器在构建项目时生成的预编译头文件不同,它是构建输出目录中的 .pch 文件。否则它扮演完全相同的角色,它大大提高了解析器的速度。它可以使用那种帮助,EDG前端从来没有特别快。

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.

删除它们很好,它们仅在您在 IDE 中加载项目时使用。如果您重新加载项目,那么 IntelliSense 将有一段时间紧张,重建 .ipch 文件,重新解析项目中的文件并在项目目录中重新创建 .sdf 文件。在很容易花费几分钟的大型项目上。当然,.ipch 文件越大,所需的时间就越长。这是您通常只在完成项目后才会考虑的事情。

回答by Yola

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 Locationin Tools>Options to true. After this you can delete ipch folder from your solution's folder and it will not appear there again.

您无法根据解决方案更改 ipch 文件的位置,但您可以为整个 VS 安装执行此操作。为此,您需要Always Use Fallback Location在 Tools>Options 中更改为true. 在此之后,您可以从解决方案的文件夹中删除 ipch 文件夹,它不会再次出现在那里。

enter image description here

enter image description here

You can read a bit more here

你可以在这里阅读更多