Evil Xcode Issue

Discussion in 'Mac Programming' started by Blakeasd, Jul 6, 2011.

  1. Blakeasd macrumors 6502a

    Dec 29, 2009
    I am having yet ANOTHER Xcode issue.
    Here is the error:
    Here is the file's location:
    As you can see Xcode is searching for the header:
    WHAT IS THE ISSUE?? Why is Xcode saying it can't find it? :confused:
    Please Help and Thanks!
  2. gnasher729 macrumors P6


    Nov 25, 2005
    What's the difference between

    #include <thisfile.h>


    #include "thisfile.h"

  3. ehoui macrumors regular

    Jan 27, 2011
  4. jiminaus macrumors 65816


    Dec 16, 2010
    I don't think the OP of this thread wants (nor do I think he should) set up a global path setting.

    @Blakeasd gcc has very simple algorithm for locating a header file. It goes a little something like this.

    let header_file be what's inside the <> of a #include
    let search_paths be the header search paths build setting
          plus come search paths compiled into gcc (eg /usr/include)
    loop for each path in search_paths
      let candidate_path be path + "/" + header_file
      if candidate_path exists
        replace the #include <> with the contents of candidate_path
              while recursively applying this procedure to any #include
              in the replacement content
        exit the procedure
      end if
    end loop
    report that the header file was not found

    Simply, based on the your current build settings, does "/Users/blake/Desktop/PhysicsDemo/Box2D/Common/b2Settings.h" exist? If not, you need to fix the Header Search Paths build setting.

    The XCode project tree is not necessarily a good indication of where a file actually is. This is because of file references. For example, when you added the Box2D directory to XCode, you could have chosen to include only a reference to it, and not to copy it into the project directory. The actually location of the Box2D directory could be anywhere.

    So a screen shot of the XCode project tree is rather useless. Go into Finder and find out where the Box2D directory actually is. Use that information to construct an appropriate Header Search Paths build setting. (If you still not getting it, it'll be the full absolute path up to but not including Box2D).

    BTW This is a direct follow on from Odd Xcode Error.
  5. ehoui macrumors regular

    Jan 27, 2011
    Nor do I, but if you actually look in that thread there is a discussion about the non-global setting (I mentioned this in my post... "for a project"). There is discussion about this behavior in many places. I would try those first before trying to discover the answer.
  6. Blakeasd thread starter macrumors 6502a

    Dec 29, 2009
    I added an extra /PhysicsDemo and it worked. The way I got the original path I was using was by using ${PROJECT_DIR}. I was under the impression that ${PROJECT_DIR} would take me directly to the resources, but there was another subfolder to get to the resources.
    Thanks Everyone!

Share This Page