Re: Precomp twice, fail once?
Re: Precomp twice, fail once?
- Subject: Re: Precomp twice, fail once?
- From: Tom Harrington <email@hidden>
- Date: Wed, 1 Dec 2004 13:29:03 -0700
On Tue, 30 Nov 2004 21:11:29 -0700, Nick Zitzmann <email@hidden> wrote:
>
> On Nov 30, 2004, at 5:07 PM, Tom Harrington wrote:
>
> > So for some reason XCode is determined to get AppKit.h included in
> > this file, even though the file has no dependencies on AppKit. Why
> > does it want to do this, and how can I convince it to act otherwise?
>
> The target templates are set up in a way so that they make no
> assumptions about what's inside the project. That's why some of the
> Cocoa targets include flags like "-framework Foundation -framework
> AppKit" in them. Of course, if you end up double-linking the target to
> a library, then the build will fail spectacularly in a manner you
> previously described.
The target did have "-framework AppKit" in its linker flags, but that
wasn't the problem (removing it made no difference in the results).
But that suggestion got me looking, and I noticed that it had the
prefix header set to
$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h.
Removing that cleared things right up.
Another workaround was to tell XCode to compile all sources as
Objective-C rather than using the filename extension (which I guess
prevented it from attempting to precompile AppKit.h with a ""-x
c-header" arg), but that seemed ugly. I mean, I don't have any C++ in
this target at the moment, but I wouldn't want to defeat XCode's
handling of mixed languages.
> But why that's occurring in a shell tool target is beyond me, unless
> the line appears somewhere in the target's settings or build style
> settings. When I create a shell tool target in a project, that tool
> doesn't include the AppKit header in it. The only thing I can suggest
> is to try opening the project.pbxproj file in a text editor, look
> around for the substring "AppKit", and see what you find... Maybe
> something got misplaced somewhere.
I guess I should have been put on guard by the fact that the new
target was a Cocoa shell tool, when what I really wanted was a
Foundation tool. But Foundation tool's only available when creating a
new project, not when adding a target to a project.
Even being a Cocoa shell tool, I'm surprised XCode would attempt to
forcibly include AppKit.h from the command line into files that didn't
otherwise have it. Linking to the AppKit framework makes perfect
sense in this case, but force-feeding the header just seems weird.
--
Tom Harrington
email@hidden
_______________________________________________
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