Re: Incorrect SDK Headers
Re: Incorrect SDK Headers
- Subject: Re: Incorrect SDK Headers
- From: Jason Swain <email@hidden>
- Date: Fri, 14 Jan 2011 14:56:43 +0000
That sorted it out. Thanks for your help.
As I was beginning to expect it was something embarrassingly simple. The code had #ifdef TARGET_OS_IPHONE where it should have had #if TARGET_OS_IPHONE. I've had a look and 10.5 does not define TARGET_OS_IPHONE, and 10.6 defines it as 0.
Jason
On 14 Jan 2011, at 14:11, Andreas Grosam wrote:
>
> On Jan 14, 2011, at 1:39 PM, Jason Swain wrote:
>
>> Thanks for your suggestions, I've made the changes you listed and still have the same error.
>>
>> So next I tried creating a new project, as suggested. I tried to change as little as I could from the defaults, just enough to get it compiling. This gave the same error.
>>
>> I tried building on a different machine (although one that has built all the other code so not a clean install), and this also failed.
>>
>> The strange things is that this is a compile command for 10.5 that succeeds:
> <...>
>>
>> And this is the same compile for 10.6, which fails:
>>
> <...>
>> As you can see they are almost identical. For some reason though the 10.6 version is not reading the 10.6 sdk TargetConditionals.h file.
> From the presented transcript it is unlikely that there is something wrong with the Base SDK.
>
>>
>> Does anyone know of any compiler options that I could add that would show me what files are being read as the code (and the precompiled headers) are being processed?
>
> You can "preprocess" a module to figure this out:
>
> In Xcode, display a module (say MyClass.m) in the editor. Then perform the command Build -> Preprocess.
> What you get after a few seconds is the output file of the preprocessor (e.g. MyClass.mi) displayed in the editor. It will contain lines which show which headers have been included to build up the translation unit. It may look something like this:
>
> # 1 "/Users/you/Develop/MyFancyApp/Sources/AppDelegate.m"
> # 1 "/Users/you/Develop/MyFancyApp/Sources//"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 1 3
> # 1 "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h" 1 3
> # 11 "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h" 3
> # 1 "/Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/types.h" 1 3 4
> # 72 "/Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/types.h" 3 4
> # 1 "/Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/appleapiopts.h" 1 3 4
> # 73 "/Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/types.h" 2 3 4
> ...
> # 1 "/Developer/SDKs/MacOSX10.6.sdk/usr/include/TargetConditionals.h" 1 3 4
> ...
>
>
> So, if the base SDK is setup correctly, TargetConditionals.h should be included from the Base SDK which has been set in the Target Settings accordingly.
>
> If you do not find any suspect path in this file, for instance including something from "/Developer/Platforms/iPhoneSimulator.platform", your project setup seems correct regarding the Base SDK (which does not mean, that there may be no other errors).
>
> Looking at your transcripts, I highly doubt there is something wrong here, though. Letting us know what actually goes wrong, would be a great help :)
>
>
> Andreas _______________________________________________
> 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
_______________________________________________
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