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

zeppenwolf

macrumors regular
Original poster
Nov 17, 2009
129
3
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...

Thanks.
 
Are you sure the Header Search Paths is set for the configuration you're building? e.g. Development/Deployment (or Debug/Release).
 
Are you sure the Header Search Paths is set for the configuration you're building? e.g. Development/Deployment (or Debug/Release).

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:


Carbon Headers $(HEADER_SEARCH_PATHS_QUOTED_FOR_TARGET_1)


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:


\"$(SYSTEM_DEVELOPER_DIR)/Headers/FlatCarbon\"
 
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?
 
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.
 
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...

Thanks.

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

/System/Library/Frameworks/Carbon.framework

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

/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h

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

/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/

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

/System/Library/Frameworks/Carbon.framework/

This applies to all frameworks within

/System/Library/Frameworks/

Btw,
http://developer.apple.com/library/...l/BPFrameworks/Tasks/IncludingFrameworks.html
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.