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

前端 未结 11 1157
时光说笑
时光说笑 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:15

    I thought I would add a separate answer rather than a comment to Cryptognome's answer, because it is in fact a different solution when the issue comes from running xcodebuild. Like Cryptognome, I had the error come up with the command-line tool xcodebuild. As an alternative to manually going into the /var subfolders, I found that I could set my own cache for the shared PCH, which you can do by setting the environment variable SHARED_PRECOMPS_DIR, e.g as follows

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

    This way, I never get the error in automatic builds.

    Note in the above command, I would also typically set the OBJROOT and SYMROOT env var to build also in /tmp. At the end, I clean things up.

提交回复
热议问题