• 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: Header Search Paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header Search Paths


  • Subject: Re: Header Search Paths
  • From: Heath Raftery <email@hidden>
  • Date: Tue, 24 Feb 2004 16:33:09 +1100

Hi Randy,

On 24/02/2004, at 2:06 PM, Randy Croucher wrote:
I want my includes to come before the system includes. But I don't know how the system includes are even being searched. How do I put my "Header Search Paths" in front of /usr/include? Who told it to even search /usr/include?

The answers are hidden deep with the gcc man page. gcc (or in Apple's case, cc), the GNU C compiler, is what XCode uses to compile your application with the headers it uses. You can read its manual page by typing "man gcc" in a Terminal window. The parts relevant to your query are here:


-I dir
Add the directory dir to the list of directories to be searched for
header files. Directories named by -I are searched before the
standard system include directories. If the directory dir is a
standard system include directory, the option is ignored to ensure
that the default search order for system directories and the spe-
cial treatment of system headers are not defeated .


-nostdinc
Do not search the standard system directories for header files.
Only the directories you have specified with -I options (and the
directory of the current file, if appropriate) are searched.


-nostdinc++
Do not search for header files in the C++-specific standard direc-
tories, but do still search the other standard directories. (This
option is used when building the C++ library.)


Apart from reading the cc source code, I don't know of any simple way to get a list of the standard system include directories. But I'd hazard a guess that they would be close to this list:

/usr/include
/usr/local/include

So in answer to your original question, you should be able to insert your directory into the start of the search path by simply adding it to the Header Search Path option in your target's info. You can confirm that the correct flag is being passed to the compiler by reviewing the detailed output during a build.

Heath
--
 ____________________________________________________
|   Heath Raftery                                    |
|   email@hidden                           |
|   *A mind all logic is like a knife all blade -    |
|      it makes the hand bleed that uses it.*        |
|              - Rabindranath Tagore     _\|/_       |
|_______________________________________m(. .)m______|
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Header Search Paths
      • From: Randy Croucher <email@hidden>
    • Re: Header Search Paths
      • From: Chris Ridd <email@hidden>
    • Re: Header Search Paths
      • From: Eric Zylstra <email@hidden>
References: 
 >Header Search Paths (From: Randy Croucher <email@hidden>)

  • Prev by Date: Header Search Paths
  • Next by Date: Re: Header Search Paths
  • Previous by thread: Header Search Paths
  • Next by thread: Re: Header Search Paths
  • Index(es):
    • Date
    • Thread