Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
I am having yet ANOTHER Xcode issue.
Here is the error:
ScreenShot2011-06-28at22942PM.png

Here is the file's location:
ScreenShot2011-07-02at31713PM.png

As you can see Xcode is searching for the header:
ScreenShot2011-07-06at32312PM.png

WHAT IS THE ISSUE?? Why is Xcode saying it can't find it? :confused:
Please Help and Thanks!
 
What's the difference between

#include <thisfile.h>

and

#include "thisfile.h"

?
 
I recommend you do the Google search and try some of the solutions offered. E.g.,

http://stackoverflow.com/questions/749027/how-to-add-a-global-include-path-for-xcode

Note the OP was trying to do some across multiple projects, but there are answers in that thread about how to set it up for a project.

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.

Code:
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.
 
I don't think the OP of this thread wants (nor do I think he should) set up a global path setting.

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.
 
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.