可以从 Xcode 项目中删除 Prefix.pch 文件吗? [英] Is it OK to remove Prefix.pch file from the Xcode project?

查看:27
本文介绍了可以从 Xcode 项目中删除 Prefix.pch 文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 项目自动生成 Prefix.pch 文件.当我删除此文件并尝试构建时,我收到构建错误,提示*_Prefix.pch"文件丢失.

The Xcode project generates Prefix.pch file automatically. When I deleted this file and tried to build, I got build error saying '*_Prefix.pch' file is missing.

  • 是否必须使用 Prefix.pch 文件才能使用 Xcode 进行编译?
  • 如何在没有 Prefix.pch 文件的情况下进行构建?

推荐答案

在 Xcode 中,转到目标的构建设置(Command-Option-E,构建选项卡)并取消选中 Precompile Prefix Header (GCC_PRECOMPILE_PREFIX_HEADER).如果需要,您还可以删除 Prefix Header 设置的值.

In Xcode, go to your target's build settings (Command-Option-E, build tab) and uncheck Precompile Prefix Header (GCC_PRECOMPILE_PREFIX_HEADER). You can also remove the value of the Prefix Header setting if you wish.

前缀头被编译并存储在缓存中,然后在编译期间自动包含在每个文件中.这可以加快编译速度,并让您包含一个文件,而无需向使用它的每个文件添加导入语句.它们不是必需的,而且在您更改它们时实际上会减慢编译速度.

Prefix headers are compiled and stored in a cache, and then automatically included in every file during compilation. This can speed up compilation, and lets you include a file without adding an import statement to every file using it. They are not required, and actually slow compilation whenever you change them.

这篇关于可以从 Xcode 项目中删除 Prefix.pch 文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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