• 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:58:37 -0800


On Nov 20, 2006, at 10:46 PM, Chris Espinosa wrote:

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.

(Oh, and by the way, notice you said "adding header files to the project" and I replied "adding header files to the target."  There's a big difference.  Project members are just there, as you say, for one-click access, as well as SCM, etc.  But target members are in the list of things to get processed at build time.  Include files technically should not be processed unless they're being copied (framework-like) into the build product.  They can be referred to by source files that are being processed, of course, but they themselves don't have a build step, so they shouldn't be added to a target.  When you add a header file to a project, make sure all the "Add to Targets" boxes are unchecked, unless you specifically want the header file to be copied somewhere at build time.)

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

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>)
 >Re: Targets and include files.. (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Targets and include files..
  • Next by Date: Parallel builds on Intel Mac failing..... start loosing trust in MacOS X....
  • Previous by thread: Re: Targets and include files..
  • Next by thread: Re: Targets and include files..
  • Index(es):
    • Date
    • Thread