Re: Targets and include files..
Re: Targets and include files..
- Subject: Re: Targets and include files..
- From: Andrew Cunningham <email@hidden>
- Date: Mon, 20 Nov 2006 22:32:39 -0800
On Nov 20, 2006, at 9:50 PM, Chris Espinosa wrote:
etermines header-finding in Xcode, just like in CodeWarrior, is the
Header Search Path. If you have two different headers with the
same name in different targets, the Header Search Paths in those
targets need to be set differently, so that the compiler finds the
right one for the target first. You're right, Xcode does set this
for you automatically—but it can't really intuit that you mean a
different A.h in target 2 than in target 1, so it's up to you to
set target 2's Header Search Paths differently, so it finds Headers/
Target 2/A.h and not Headers/Target 1/A.h.
What I'd do is remove A.h from both targets, and then make sure
that Target 1 has a Header Search Path to Headers/Target 1 and
Target 2 has a Header Search Path to Headers/Target 2.
Chris,
First, thanks for the quick and helpful response!
I understand that the header search paths should be different for
each target, so the target should find the correct header file (e.g.
"Target1/A.h" and Target2/A.h) in my example. I definitely had done
this. According to the search paths, Target 2 should not be finding
Target1/A.h, but it is.
But what you seem to be saying is that I have caused the problem by
adding the header file to the project, thus causing XCode to do
something in the one of its builds phases that makes the header file
available to all targets, thus defeating the header search paths
above. It's really handy to have on-click access to header files, and
seems a pretty typical way of organizing things that most people do ,
in say, shudder, Visual Studio. So instead of removing the header
file can I just make sure the header file(s) is not a member of any
target?
Andrew _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden