什么是 .h.gch 文件?

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

问题描述

我最近有一个课堂项目,我必须用 G++ 编写一个程序.

I recently had a class project where I had to make a program with G++.

我使用了一个 makefile,但出于某种原因,它偶尔会留下一个 .h.gch 文件.

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.

我有两个问题:

1) .h.gch 文件是什么,它的用途是什么?和

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

2) 为什么不清理会出现这样的问题?

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

推荐答案

.gch 文件是一个预编译的头文件.

A .gch file is a precompiled header.

如果没有找到.gch,则使用正常的头文件.

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.

有时 *.h.gch 会损坏或包含过时的信息,因此删除该文件并重新编译应该可以修复它.

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

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)