Re: Header Search Paths
Re: Header Search Paths
- Subject: Re: Header Search Paths
- From: Randy Croucher <email@hidden>
- Date: Mon, 23 Feb 2004 23:39:41 -0800
Thanks, I actually had my Header Search Paths (-l) set, but it still
finds the system one before mine. I found the -v option to spit out
what the search order is. It claims it is correct, but I placed and
intentional error in my header, and it never hits it. I can get it to
work if I actually add my version of the header files to the project,
but I don't want to have to do that. I did not know about -nostdinc
though. I will give it a try.
Thanks,
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.
_______________________________________________
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.