Xcode 6.1 预编译头文件 [英] Xcode 6.1 Precompiled Headers

查看:28
本文介绍了Xcode 6.1 预编译头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Xcode 6.1 中,创建新项目不会使用单视图 iOS 项目模板创建预编译头文件.如果我手动添加一个,pch 文件中的任何定义在任何其他源文件中都不可用.

In Xcode 6.1, creating a new project does not create a precompiled header file using the single view iOS project template. If I add one manually, any definitions in the pch file are not available in any other source files.

我查看了许多线程和问题,并尝试清理、重新构建、重新启动、删除派生数据并手动删除 CACHE_ROOT/SharedPrecompileHeaders 文件夹.然而,一切都无济于事.

I've looked at many threads and questions and tried cleaning, re-buiding, re-starting, deleting derived data and manually removing the CACHE_ROOT/SharedPrecompileHeaders folder. All to no avail, though.

一些信息建议勾选包含在目标中,但现在对 pch 和其他头文件禁用.

Some info suggests ticking to include in targets, but this is disabled for pch and other header files now.

见下方评论.

推荐答案

您是否尝试过添加 pch 文件的路径?

Have you tried adding the path of the pch file?

转到你的项目->构建设置 ->Apple LLVM 6.0 语言.

在它下面,设置以下内容:

Under it, set the following things:

  • 预编译前缀头:将其设置为 YES
  • 前缀头:设置pch文件的路径

更新 2018/09/23:在 Xcode10 中,它位于 Apple Clang - Language

Update 2018/09/23: In Xcode10 it is under Apple Clang - Language

这篇关于Xcode 6.1 预编译头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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