Why can't Xcode find this header file?

Hi, I get xcode "no such file or directory" for:

#import "Three20Core.h" 

I also note when I type the #import operator, which it recognizes, and helps to autocomplete the file "Three20Core.h", however, do I get an error while compiling?

This is the main library file header for the Three20 library (from Facebook). Thus, I have a three20 directory at the same level as the application directory. In the settings of the target installation of the Xcode application:

  • Header search paths are "$ (BUILT_PRODUCTS_DIR) /../../../ three20" and recursive, and
  • The search paths for user headers are the same as above.

What is the diagnostic tip?

+6
source share
4 answers

The problem was that I did not understand the changes in the Xcode 4 build system compared to Xcode 3. All I had to do was set the header paths to:

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

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

+2
source

See an extended version of this answer here: Xcode 4 Unspecified Archived Version

I found a lot of problems with Xcode 4 when it comes to complex project structures.

  • Create a group in your project called Indexing
  • Drag header files to this group
  • When prompted to select a goal, uncheck ALL goals

This solved most of my Xcode 4 issues.

Related questions:

+5
source

I got another possible reason:

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

0
source

Source: https://habr.com/ru/post/885717/


All Articles