Xcode 4.1 fatal error: stdlib changed because precompiled header was compiled

Create an iPhone app using:

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

I started getting the following error:

Fatal error: file '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/../lib/clang/2.1/include/stdint.h' was changed after creating a precompiled header

I tried reinstalling Xcode and OS X - no luck. What causes this?

+73
ios xcode compiler-errors
Aug 15 '11 at 10:25
source share
11 answers

First, try creating a clean assembly through the Product β†’ Clean menu (with XCode 4.6.2).

If this does not work, open the Organizer (select "Window-> Organizer" from the menu). When the Organizer is open, select "Projects" in the toolbar at the top of the window. On the left is a list of projects, select the one with which you have a problem.

In the details panel (to the right of the list), the name, location, project status will be displayed. The line below it shows where the Derived Data is. Click the "Delete ..." button on the right. A dialog box appears, click "Delete."

You can also manually delete derived data:

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

This directory contains built-in products and indexes for the project. This is fine to delete, because it only contains elements generated by Xcode. Xcode will restore everything the next time the project is opened.

+153
Aug 16 '11 at 0:10
source share

I was able to fix this a lot easier by simply choosing Product> Clean, then Product> Create from the Xcode context menu.

+76
Mar 12 2018-12-12T00:
source share

Deleting the DerivedData folder did not work for me when archiving.

I had to look at the build settings - build locations - the precompiled header cache path and delete this folder.

For me it was:

 /var/folders/_w/t0mj70hd1439tqgxff7_mtt00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders 
+37
Sep 12 2018-11-11T00:
source share

I thought I would add a separate answer, not a comment for the Cryptognome answer, because this is actually a different solution when the problem arises from running xcodebuild . Like Cryptognome, I got an error with the xcodebuild command-line xcodebuild . As an alternative to manually navigating to /var subfolders, I found that I can set my own cache for shared PCH, which you can do by setting the SHARED_PRECOMPS_DIR environment variable, for example, as follows

 xcodebuild -target Foo -configuration Release SHARED_PRECOMPS_DIR=/tmp/foo/SharedPCH 

That way, I never get an error in automatic assemblies.

Note that in the above command, I also usually installed OBJROOT and SYMROOT env var to build also in / tmp. In the end, I put things away.

+16
Nov 02 '11 at 3:25
source share

The xcodebuild command-line tool sometimes fails with this error. This happened to me when I synchronized the svn workspace with an earlier build. The xcodebuild tool stores its precompiled headers in the mentioned Ants folder:

 /var/folders/... scrambled eggs .../-Caches-/com.apple.Xcode.503/SharedPrecompiledHeaders/ 

You need to look in the build command itself to see the actual folder name (-include / var / ...), but several can be used if you create for different architectures (arm6, arm7, simulator, for example) So, if you have There was this problem with the command line assembly, just delete everything in / var /.../ SharedPrecompiledHeaders.

+4
Oct 05 2018-11-11T00:
source share

Retrieve content for Simulator using iOS Simulator> Reset Content and Settings ... and click Rest. This will remove any existing precompiled instances of headers and resources. It worked for me

+3
Aug 15 '12 at 14:45
source share

Decision:

1) Product-> Clean

2) Product-> Build

Type of error:

kind of build error

One of the reasons:

It would be possible to modify the framework file. Sometimes this happens when a change in structure occurs, on which another structure depends. The precompiled header cache goes out of sync, and Xcode cannot compile this project.

One of the scenarios:

you may have chosen Jump To Definition and made some changes after selecting the wireframe control.

+3
Aug 01 '13 at 8:41
source share

I managed to get rid of this error by simply clearing (command + shift + K) and rebuilding.

+1
May 31 '13 at 19:13
source share

I tried first but did not use. Finally, I uninstalled Xcode and installed it again. Now it works great.

Xcode-> uninstall-> install again

It might help someone ...

0
Aug 28 '14 at 2:46
source share

I had a bug on the cord when I was running: cordova run ios

 fatal error: file '/Users/.../cordova/platforms/ios/CordovaLib/CordovaLib_Prefix.pch' has been modified since the precompiled header '/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/CordovaLib_Prefix-bfgesbulnxtdepfwgniffeysypgv/CordovaLib_Prefix.pch.pch' was built note: please rebuild precompiled header '/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/CordovaLib_Prefix-bfgesbulnxtdepfwgniffeysypgv/CordovaLib_Prefix.pch.pch' 1 error generated. ** BUILD FAILED ** The following build commands failed: CompileC build/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/NSDictionary+Extensions.o Classes/NSDictionary+Extensions.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC build/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVInvokedUrlCommand.o Classes/CDVInvokedUrlCommand.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler 

I tried with clean and build, but it doesn’t work, finally I deleted the folder "/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode" and it works! This tip may help others.

0
Oct 08 '14 at 18:51
source share

Clean methods do not work for me, in the end I solved this problem, reinstall Xcode.

0
Dec 17 '14 at 6:17
source share



All Articles