Xcode 4.1 fatal error: stdlib modified since the precompiled header was built

grfryling picture grfryling · Aug 16, 2011 · Viewed 28.6k times · Source

Building an iPhone app, using:

  • Xcode 4.1
  • Base SDK iOS 4.3
  • Apple LLVM Compiler 2.1

I have started getting the following error:

fatal error: file '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/../lib/clang/2.1/include/stdint.h' has been modified since the precompiled header was built

I have tried reinstalling Xcode and OS X - no luck. What's causing this?

Answer

logancautrell picture logancautrell · Aug 16, 2011

First try a clean build via the Product -> Clean menu (as of XCode 4.6.2).

If that still doesn't work then open the Organizer (from the menu select Window->Organizer). Once the Organizer is open, select Projects from the toolbar at the top of the window. On the left is a list of projects, select the one you are having a problem with.

The details panel (to the right of the list) will display the project name, location, status. The row beneath that shows where the Derived Data is located. Click the Delete... button the far right. A dialog will appear, click Delete.

You can also manually delete the Derived Data:

~/Library/Developer/Xcode/DerivedData/{project name + gobly-gook}

This directory contains built products and indexes for the project. It is OK to delete it because it only contains items generated by Xcode. Xcode will regenerate everything next time the project is opened.