Xcode 4无法从静态库依赖关系找到公共头文件 [英] Xcode 4 can't locate public header files from static library dependency

查看:208
本文介绍了Xcode 4无法从静态库依赖关系找到公共头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


替换标题以帮助搜索




  • Xcode无法找到标题

  • Xcode中缺少.h

  • 未找到Xcode .h文件

  • 未找到词法或预处理程序问题文件

我正在开发一个来自Xcode 3的iOS应用程序项目。我现在已经转移到Xcode 4我的项目构建许多静态库。



这些静态库也声明公共头文件,这些头文件被应用程序代码使用。在Xcode 3.x中,头文件被复制(作为构建阶段)到 public headers目录,然后在应用程序项目中 public headers directory 被添加到标题搜索列表中



在Xcode 4下,构建目录被移动到〜/ Library / Developer / Xcode / DerivedData / my-project

问题是我如何在标题搜索设置中引用这个新位置?看来:


  • 公共标题目录相对于 DerivedData 目录,但是
  • 标题搜索目录与其他项目相关(可能是项目位置)



我应该如何为Xcode 4中的iOS开发设置一个静态库目标,以确保头文件可供客户端使用在尝试编译为依赖时使用静态库?解决方案

解析方案

Xcode 4 Project无法编译静态库




相关问题:Xcode 4中找不到词法或预处理程序问题文件

<错误可能包括; 缺少头文件,词法或预处理器问题



解决方案:


  1. 检查用户标题路径是否正确

  2. 将始终搜索用户路径 YES

  3. 在您的项目中创建一个组呼叫索引标题,并将标题拖到该组中, 在提示时添加到任何目标。 >


Alternate titles to aid search

  • Xcode can't find header
  • Missing .h in Xcode
  • Xcode .h file not found
  • lexical or preprocessor issue file not found

I'm working on an iOS application project which came from Xcode 3. I have now moved to Xcode 4 my project builds a number of static libraries.

Those static libraries also declare public headers and those headers are used by the application code. In Xcode 3.x the headers were copied (as a build phase) to the public headers directory, then in the application project the public headers directory was added to the headers search list.

Under Xcode 4 the build directory is moved to ~/Library/Developer/Xcode/DerivedData/my-project.

The problem is how do I reference this new location in the headers search settings? It seems that:

  • public headers directory is relative to DerivedData directory, but
  • headers search directory is relative to something else (possibly the project location)

How should I set up a static library target for iOS development in Xcode 4 that will ensure the header files are made available to the clients that use the static library when trying to compile as a dependancy?

解决方案

Xcode 4 Project Fails to compile a static library

Related question: "lexical or preprocessor issue file not found " in Xcode 4

Errors might include; missing header files, "lexical or preprocessor issue"

Solutions:

  1. Check the "user header paths" are correct
  2. Set "Always search user paths" to YES
  3. Create a group call "Indexing headers" in your project and drag the headers to this group, DO NOT add to any targets when prompted.

这篇关于Xcode 4无法从静态库依赖关系找到公共头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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