why can't Xcode find this header file?

自闭症网瘾萝莉.ら 提交于 2020-01-12 07:49:04

问题


Hi I'm getting an xcode "no such file or directory" for:

#import "Three20Core.h"

I also note when I'm typing in the #import statement it recognises, and helps autocomplete, the "Three20Core.h" file, however when I compile I get the error?

This is the main library file header for the Three20 library (from Facebook). So I've got the three20 directory at the same level as my app directory. In the Xcode application target build settings:

  1. Header Search Paths - "$(BUILT_PRODUCTS_DIR)/../../../three20" and recursive, and
  2. User Header Search Paths - same as above.

Any fault finding advice?


回答1:


See an expanded version of this answer here: Xcode 4 Archive Version Unspecified

I've found many issues with Xcode 4 when it comes to complex project structures.

  1. Create a group in your project called "Indexing"
  2. Drag the header files to this group
  3. When asked to select a target uncheck ALL targets

This has solved most of my Xcode 4 issues.

Related questions:

  • Xcode 4 can't locate public header files from static library dependancy
  • “lexical or preprocessor issue file not found ” in Xcode 4



回答2:


Issue was my lack of understanding of the change in the Xcode 4 build system over Xcode 3. All that I had to do was set header paths to:

 "$(BUILT_PRODUCTS_DIR)/../three20"
 "$(BUILT_PRODUCTS_DIR)/../../three20"

per http://three20.info/article/2011-03-10-Xcode4-Support




回答3:


Have you followed this steps? http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Project




回答4:


I just had another possible cause:

After searching the whole folders, I found that there is another header file with the same file name but wrong path (and therefore it is missing to xcode). So make sure you don't have a duplicated header that has wrong path.



来源:https://stackoverflow.com/questions/5634071/why-cant-xcode-find-this-header-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!