• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Targets and include files..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Targets and include files..


  • Subject: Re: Targets and include files..
  • From: Chris Espinosa <email@hidden>
  • Date: Mon, 20 Nov 2006 22:46:27 -0800


On Nov 20, 2006, at 10:32 PM, Andrew Cunningham wrote:

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?


I'm not sure that you caused this by adding the headers to the target.  It could be a number of things: recursive search paths, A contains B, you added other files from 2's path to 1 earlier so the 2 paths come first in 1's Header Search Paths, etc.  One diagnostic would be to add -v to the Other C Flags of each target and compile one source file in each that #includes A.h.  The compiler will output the specific search paths in each case, and it's straightforward to see what order it's looking in what directories in, and why.

One thing that Xcode does do, though, is to pass "headermaps" to the compiler to speed up file system searching.  This is known to have problems in targets that use two different headers with the same name in the same target though we don't know of cases where this breaks with different targets.  Setting the custom build setting USE_HEADERMAP = NO in both targets, then rebuilding, would show whether this is indeed the problem.

In either case, it's worth filing a bug with the detailed (-v) build transcripts of both targets so we can see why the wrong one is getting picked up, and make it work more intuitively.

Chris
 _______________________________________________
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

  • Follow-Ups:
    • Re: Targets and include files..
      • From: Andrew Cunningham <email@hidden>
    • Re: Targets and include files..
      • From: Chris Espinosa <email@hidden>
References: 
 >Targets and include files.. (From: Andrew Cunningham <email@hidden>)
 >Re: Targets and include files.. (From: Chris Espinosa <email@hidden>)
 >Re: Targets and include files.. (From: Andrew Cunningham <email@hidden>)

  • Prev by Date: Re: Targets and include files..
  • Next by Date: Re: Targets and include files..
  • Previous by thread: Re: Targets and include files..
  • Next by thread: Re: Targets and include files..
  • Index(es):
    • Date
    • Thread