why can't Xcode find this header file?
Asked Answered
S

4

7

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?

Slone answered 12/4, 2011 at 10:55 Comment(0)
S
3

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

Slone answered 14/4, 2011 at 0:9 Comment(0)
S
5

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:

Seidler answered 12/4, 2011 at 11:37 Comment(5)
I'll have a look into this rjstelling - I must admit I don't really understand what these suggestions are aiming to do and how they might help...should I be concerned about this?Slone
by the way - any specific comments on "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?". That is, should this be the case? Or asking another way, is it the case the XCode uses separate config for auto-completion as opposed to build?Slone
Xcode 4 has a completely new indexing system, my guess is it still has some bugs. I.e. in your case finding the "Three20Core.h" file (presumably via Header Search Paths) but the pre-processor (also new) can't. Adding the headers to the project or workspace as an explicit reference seems to solve this.Seidler
Creating the new group and dragging the files totally fixed it for me. (for a different header file missing, but similar problem). Very odd behavior.Eulaheulalee
Thank you! I was pulling my hair out trying to fix this, and your solution helped!Millicentmillie
S
3

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

Slone answered 14/4, 2011 at 0:9 Comment(0)
S
0

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

Strathspey answered 12/4, 2011 at 11:38 Comment(1)
thats what I've been trying to do, unfortunately it's was written for the xcode 3 IDE. Although there's a migration guide it still doesn't quite allow me to get there from a 'trained monkey' perspective :) Trying to go through some doco/videos on the xcode/C build system at the moment. Know how to develop a table view app, but still don't fully understand xcode build systemSlone
F
0

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.

Feaster answered 3/3, 2014 at 15:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.