<includes> in upgraded Carbon

Discussion in 'Mac Programming' started by zeppenwolf, Mar 8, 2011.

  1. zeppenwolf macrumors regular


    Nov 17, 2009
    I have a carbon project with old style includes, like "#include <Sound.h>". I brought the project builder file and source to a X.6 machine, changed the extension, and then did the "Upgrade all targets to native" thing to get rid of the "Jam" business.

    In the project settings, "HEADER_SEARCH_PATHS = Carbon Headers \"Developer/Headers/FlatCarbon\" is listed, that path exists, and it does in fact contain a file called "Sound.h".

    Yet when I compile a source file containing the line, "#include <Sound.h>", it says "no such file or dir".

    In the monster "/Developer/usr/bin/gcc-4.0" command I can see it too: it says '-I"/Developer/Headers/FlatCarbon" ' in there.

    What gives? I could go through all the source adding #ifdefs, since my pch contains Carbon/Carbon.h, (which is all Sound.h does anyway), but I'd prefer not to...

  2. kainjow Moderator emeritus


    Jun 15, 2000
    Are you sure the Header Search Paths is set for the configuration you're building? e.g. Development/Deployment (or Debug/Release).
  3. zeppenwolf thread starter macrumors regular


    Nov 17, 2009
    Yes, when editing "All Configurations / At This Level", it looks like:

    Header Search Paths | Carbon Headers \"/Developer/Headers/Flat Carbon\"

    and when I click on the value part, it changes to:


    In "All configurations / User Defined ", it appears as:

    HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = \"/Developer/Headers/FlatCarbon\"

    and clicking on the value part reveals the variable:

  4. kainjow Moderator emeritus


    Jun 15, 2000
    Weird. I'm not sure. I created a new project, added that path to the header search paths, and #including Sound.h worked fine.

    Possibly there is another setting that is conflicting with it?
  5. zeppenwolf thread starter macrumors regular


    Nov 17, 2009
    OK, this might seem lame, but here it is.

    Where the upgrade process created \"/Developer/Headers/Flat Carbon\" for me, if I just remove the \" pair it works fine.

    Reminds me of college, and struggling with the csh...

    Thanks, kainjow. See you on the next one.
  6. Mr. Retrofire macrumors 603

    Mr. Retrofire

    Mar 2, 2010
    If you use framework-style includes (recommended on Mac OS X), then you must tell the compiler, where he can find the header files and other appropriate files. In the case of Carbon projects, just add

    #include <Carbon/Carbon.h>

    to your prefix file (must be the first line) and add


    to your project. Xcode should find then the other frameworks via


    As you see in Carbon.h, the Carbon framework depends on many other frameworks, and Xcode cannot resolve the framework dependencies, if it has no


    path. Xcode finds this path automatically via the "Header" alias in


    This applies to all frameworks within



Share This Page