什么是.h.gch文件? [英] What is a .h.gch file?

查看:788
本文介绍了什么是.h.gch文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近有一个类项目,我不得不制作一个程序与G ++。我使用了一个makefile,由于某种原因,它偶尔会留下一个.h.gch文件。有时,这不会影响编译,但是每次都会导致编译器针对已修复或没有意义的问题发出错误。我有两个问题:



1).h.gch文件是什么?和



2)为什么在未清除时会导致此类问题?



帮助。

解决方案

.gch 文件是一个预编译头。 / p>

如果未找到 .gch ,那么将使用正常的头文件。



但是,如果你的项目设置为生成预编译的头文件,它将使它们如果不存在并在下次构建中使用它们。



有时候 *。h.gch 会损坏或包含过时的资讯,因此删除该档案并进行编译再次应该修复它。


I recently had a class project where I had to make a program with G++. I used a makefile and for some reason it occasionally left a .h.gch file behind. Sometimes, this didn't affect the compilation, but every so often it would result in the compiler issuing an error for an issue which had been fixed or which did not make sense. I have two questions:

1) What is a .h.gch file and what is one used for? and

2) Why would it cause such problems when it wasn't cleaned up?

Thanks for the help.

解决方案

A .gch file is a precompiled header.

If a .gch is not found then the normal header files will be used.

However, if your project is set to generate pre-compiled headers it will make them if they don’t exist and use them in the next build.

Sometimes the *.h.gch will get corrupted or contain outdated information, so deleting that file and compiling it again should fix it.

这篇关于什么是.h.gch文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆