Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #include, gcc, -I, -I-, and same named files



Hello Devang.

Thanx for the reply.

on 6/26/03 1:32 PM, Devang Patel at email@hidden wrote:

> On Thursday, June 26, 2003, at 9:31 AM, John C. Daub wrote:
>>
>> How can I get this working so that when the statement is:
>>
>> #include "foo/string.h"
>>
>> it picks up the foo/string.h, and when the statement is:
>>
>> #include <string.h>
>>
>> it picks up the system's string.h?
>>
>> (and please, no arguments about the filename or suggestions to just
>> rename
>> the foo/string.h file to some unique name... that's not a viable
>> option in
>> my situation).
>>
>> Thanx for any help you can give. :-)
>
> hmm... you're being hit by 'secret' dialogue between PB and GCC.

*doh*

> PB thinks that if you have string.h header in your project then you
> always
> want to refer it (even when you say #include <string.h>). Under this
> philosophy PB passes header name and location map to GCC and it
> short-circuits GCC's header search for that header. (Now you know
> what -header-mapfile option is doing :-).
>
> I do not know how you can convenience PB to stop supplying hints about
> string.h. One possible work around is to remove string.h from PB
> project.
> Keep it in your source folder but do not tell PB about its existence.
> But you
> know that this is not safe because you'll have to take care of string.h
> separately.

When you say "having string.h in my project", do you mean that the file
would be listed in the Files tab of the PB window and/or within the list of
files within the Headers build phase? If so, that's not the case. I haven't
explicitly added the any/string.h file nor any file named "string.h" to my
project. I assume the any/string.h file is somehow getting found by PB/gcc
when the .hmap file is being created. Am I misunderstanding you and what
you're suggesting to try?

Is there any way to suppress the -header-mapfile option and/or PB's
insertion of that option into the gcc command string? From your comments
above it doesn't sound like it.

Why does PB and gcc have this secret dialogue? What's the advantage(s) that
it brings? I've already found one disadvantage, and are there any others?

--
John C. Daub }:-)>=
<mailto:email@hidden> <http://www.hsoi.com/>
"I have a big head. My head is huge!" - Space Ghost
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: #include, gcc, -I, -I-, and same named files (From: Devang Patel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.