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

前端 未结 11 1058
时光说笑
时光说笑 2020-12-12 15:54

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

相关标签:
11条回答
  • 2020-12-12 16:16

    I was able to get rid of this error simply by cleaning (command+shift+K) and rebuilding.

    0 讨论(0)
  • 2020-12-12 16:18

    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.

    0 讨论(0)
  • 2020-12-12 16:20

    Solution:

    1)Product->Clean

    2)Product->Build

    Error Type:

    a kind of Build error

    One of the causes:

    one might have changed the framework file. This sometimes happens when a change is made to a framework that another framework depends upon. The precompiled header cache gets out of sync, and Xcode is unable to compile the given project.

    One of the Scenarios:

    one might have chosen Jump To Definition and did some change after selecting a framework control.

    0 讨论(0)
  • 2020-12-12 16:22

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

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

    You have to look in the build command itself to see the actual folder name (-include /var/...), but it may be using several if you're building for different architectures (arm6, arm7, simulator, e.g.) So if you're having this problem with a command line build, just delete everything in /var/.../SharedPrecompiledHeaders.

    0 讨论(0)
  • 2020-12-12 16:22

    I had this error on cordova when I ran : 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 doesn't work, finaly I removed the folder '/var/folders/gb/3cf6hy4x7z3d7hprls6xmd0m0000gr/C/com.apple.DeveloperTools/6.0-6A313/Xcode' and works! This tip, may be help others

    0 讨论(0)
提交回复
热议问题