Re: say, what happened to prefix files?
Re: say, what happened to prefix files?
- Subject: Re: say, what happened to prefix files?
- From: Matt Neuburg <email@hidden>
- Date: Thu, 04 May 2006 22:30:45 -0700
- Thread-topic: say, what happened to prefix files?
On or about 5/4/06 7:20 PM, thus spake "Chris Espinosa" <email@hidden>:
> On May 4, 2006, at 5:32 PM, Matt Neuburg wrote:
>
>> I just noticed that in new projects the prefix header file isn't
>> being used.
>> The prefix header file imports <Cocoa/Cocoa.h>, which theoretically
>> means
>> that other headers don't have to. But in fact they do have to; if you
>> comment out the #import line in any of them, the project won't
>> compile.
>>
>> So what happened here? The prefix header file used to work - or did
>> I dream
>> it? m.
>
> Please provide a little more information:
>
> - what version of Xcode
> - what kind of new project (I'm deducing one of the Cocoa ones, but
> app? Framework? Tool?)
> - what configuration, architecture, target
> - Did you check the "Prefix file" and "Precompile prefix file" build
> settings for that target and configuration?
> - What does the build transcript say?
> - When you say "doesn't compile," please provide both the compiler
> invocation and the errors generated.
XCode 2.2. Nothing special about this installation; I have not messed with
the templates or anything. In fact, this happens on every machine I own,
with separate XCode installations, so I have to assume the phenomenon is as
she comes from the factory.
Make a new Cocoa Application project; let's call it TestProject. Give it a
new Objective-C Class file; let's call it MyClass.h and MyClass.m. In
MyClass.h, delete this line:
#import <Cocoa/Cocoa.h>
Build. Fails with one error:
In file included from /Users/mattneub/TestProject/MyClass.m:9:
/Users/mattneub/TestProject/MyClass.h:11: error: cannot find interface
declaration for 'NSObject', superclass of 'MyClass'
This is because Cocoa is not being imported. But this is what I thought the
prefix header file was supposed to do. So I'm guessing that we no longer use
the prefix header file.
"Precompile Prefix Header" is off for the project but on for the target.
"Prefix Header" is empty for the project but is $(PREFIX_HEADER) for the
target.
It's no big deal; it's just a curious change in behavior. It's just
something I stumbled on because I always used to idly delete the #import
<Cocoa/Cocoa.h> lines while thinking and staring at the screen. :) So I did
that and found I couldn't compile, whereas before it didn't matter. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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