Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX 10.7 Precompile Errors in new Xcode Projects

Tags:

xcode

macos

cocoa

I'm trying to build a new Xcode project targeting the 10.7 Mac SDK (and using llvm 3.1) and am getting a lot of parse errors during the precompile phase.

All of the Cocoa Foundation files are causing parse errors e.g.

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

/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 top level declarator CF_EXPORT const CFStringRef kCFErrorURLKey CF_AVAILABLE(10_7, 5_0); // Key to identify associated URL in userInfo. Typically one of this or kCFErrorFilePathKey is provided.

If I switch back to using 10.6 everything seems to compile and run fine.

I've attempted to remove and re-install dev tools using:

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

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

Has anyone seen a similar issue with Xcode 4.3+ and the 10.7 SDK. And what other steps should I try and take to clean/install the dev tools/Xcode?

I've uploaded the build log to http://pastebin.com/ahYzhrww.

like image 245
mmccomb Avatar asked Mar 19 '12 12:03

mmccomb


1 Answers

I ran into this not too long ago. These steps resolved it 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 choose Open Developer Tools, More developer tools...

to download the rest of the developer tools.

like image 138
zac0351 Avatar answered Nov 05 '22 09:11

zac0351