OSX 10.7 Precompilation Errors in New Xcode Projects

I am trying to create a new Xcode project targeting the Mac OS SDK 10.7 (and using llvm 3.1) and getting a lot of parsing errors at the precompilation stage.

All Cocoa Foundation files cause parsing errors, such as

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h►25:174: error: expected function body after function declaration

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h:68:43: error: expected ';' after the declaration of the top level CF_EXPORT const CFStringRef kCFErrorURLKey CF_AVAILABLE (10_7, 5_0); // Key to identify the associated URL in userInfo. Usually one of them is provided or kCFErrorFilePathKey.

If I go back to using 10.6 everything seems to compile and work fine.

I tried uninstalling and reinstalling the developer tools using:

sudo /Developer/Library/uninstall-devtools -mode=all 

... and then reinstall Xcode 4.3.1, but my builds 10.7 of any new project still fail.

Has anyone seen a similar problem with Xcode 4. 3+ and 10.7 SDK. And what other steps should I take to clean / install dev tools / Xcode?

I downloaded the build log at http://pastebin.com/ahYzhrww .

+7
source share
1 answer

I came across this not so long ago. These steps resolved this for me:

  • Remove Xcode.app from / Applications
  • Rename / Developer to / Devoper -old
  • Reinstall Xcode from the Mac App Store.

In Xcode, open the Xcode menu and select Open Developer Tools, More Developer Tools ...

to download other developer tools.

+1
source

All Articles