Re: Incorrect SDK Headers
Re: Incorrect SDK Headers
- Subject: Re: Incorrect SDK Headers
- From: Andreas Grosam <email@hidden>
- Date: Fri, 14 Jan 2011 09:46:05 +0100
On Jan 11, 2011, at 6:25 PM, Jason Swain wrote:
> I've got an XCode Project that contains multiple targets, some for iOS and some for Mac OS X. More and more this is causing problems for Xcode, but this latest problem I am a bit stuck on.
>
> I can build a Mac OS X target for OS X 10.5, but when I try and build for OS X 10.6 I get compile errors. The errors are due to the wrong version of TargetConditionals.h being used. TARGET_OS_IPHONE is defined in my Mac build and this causes the compile errors.
The macro TARGET_OS_IPHONE is defined on all platforms (Mac OS, iPhone and Simulator). On Mac OS platform, it is defined as follows:
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
...
#define TARGET_OS_IPHONE 0
>
> First I tried a Clean All, just in case this was a simple fix. Next I tried turning off precompiled headers, as I thought this may be the problem. That didn't do anything. Next I tried disabling the hmap files and set up the header search paths for my own files. This didn't help either. So somehow the iOS version of TargetConditionals.h is still being used instead of the OS X 10.6 version. Does anyone have any ideas what I should try next?
You should really confirm that invalid platform/SDK headers will be used. You can look at the transcript in the Build Results view if there are any suspect search paths or other suspect settings passed to the compiler when precompiling the prefix header or compiling a module.
Of course, I assume you have setup the target properly, especially Base SDK and architecture is set correctly for each target.
When building with precompiled headers use different prefix headers for each target.
Disable GCC_INCREASE_PRECOMPILED_HEADER_SHARING and enable PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR in all targets.
If you are unsure whether your multi target project and each target is setup correctly: create a number of projects with only one target for each of your desired target using the provided Xcode templates and compare the target settings.
Hope this helps, good luck :)
Regards
Andreas
>
> I'm using Xcode 3.2.5 with:
>
> Xcode IDE: 1760.0
> Xcode Core: 1763.0
> ToolSupport: 1758.0
>
>
> Jason _______________________________________________
> 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