Odd Xcode Error

Discussion in 'Mac Programming' started by Blakeasd, Jun 28, 2011.

  1. macrumors 6502a

    Joined:
    Dec 29, 2009
    #1
    I am getting a strange Xcode error, and I don't know why.
    This is the error I'm getting:
    [​IMG]

    The file it says I don't have is in my Xcode project as you can see from this screenshot:
    [​IMG]

    Why is this happening?? I am looking at the .h file right now :confused:
     
  2. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #2
    And if you change -

    #include <Box2D/common/b2Settings.h>

    to -

    #include "Box2D/common/b2Settings.h"
     
  3. macrumors member

    Joined:
    Jan 16, 2011
    #3
    What are the folder structure and the project name?
     
  4. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #4
    @lloydean, I get the same error. This is pre-written code that came with the Cocos2dBox2d Mac template.
    @mydogisbox What do you mean by folder structure?
     
  5. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #5
    The fact the your looking at b2Settings.h just provides that it exists.
    Where does it actually sit in your filesystem?
     
  6. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #6
    /Users/blake/Desktop/Penguin Quest/Penguin Quest/b2Settings.h
    (Penguin Quest is the name of my app)
     
  7. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #7
    I changed the #included statement to this
    Code:
    #include <b2Settings.h>
    
    and I don't get an error anymore. Will this cause me problems along the way or did I fix the issue?
     
  8. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #8
    Then how do you expect Box2D/common/b2Settings.h to find that?! There's no Box2D folder, no common folder.

    Assuming b2Settings.h doesn't include other files itself presuming it's in the common subfolder of the Box2D folder.
    Code:
    #include "b2Settings.h"
    
     
  9. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
  10. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #10
    It's wrong to use <> here. It's correct to use "". They are different.

    #include <blah.h> is the correct way to access header files on the system header file search path, including header files in linked frameworks.

    #include "blah.h" is the correct way to access header files local to your project.

    Although you didn't code b2Settings.h, it is local to your project, so it's correct to use "".

    XCode3 has the "Always search user paths" build setting set to true by default, so the mistake of using <> instead of "" isn't flagged as an error. That build setting is evil. XCode4 has the build setting set to false by default.
     
  11. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #11
    Wtf

    I am having yet another darn Xcode error:
    "Ignoring file /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks//OpenAL.framework, file was built for unsupported file format which is not the architecture being linked (x86_64)"

    This is driving me CRAZY, I've spent at least an hour correcting the include lines and now this weird error!

    Can you please help? Whoever wrote this template is trying to drive me crazy I think :confused:
     
  12. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #12
    #include statement with Box2d

    I am having issues with Box2d. Here is the error:
    [​IMG]
    As you can see the file exists and it IS in the right spot.
    [​IMG]


    What's going on?! :confused: I think it has to do with the <> and maybe it should be "", but how can I just get the <>s to work because there are probably 1,000 of these includes.
    Thanks
     
  13. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #13
    Now that you have the full and property file hierarchy for Box2D, you indeed need to use <> instead "". Add the path to the Supporting Files directory to your project's or target's header search paths build setting.
     
  14. thread starter macrumors 6502a

    Joined:
    Dec 29, 2009

Share This Page