0

We have inherited a codebase from a developer who is now out of radar range in Australia. Our company has bought some Mac Minis, we have installed Xcode 5.1 and the project will not build. My boss claims it built under 5.0 so it can't be far off, but... Anyway the error that is currently breaking it is when it builds the precompiled header:

clang:error: no such file or directory '/Users/..../DerivedData/<app>-<gibber>/Build/Intermediates/PrecompiledHeaders/<App>_Prefix-<gibber>/<App>_Prefix.pch.dia

The (App)_Prefix.pch file exists, and it is correctly specified in the build setting because if I move it, the error changes to "Can't find pch file".

Things I have tried:

  • Deleting the DerivedData folder
  • Restarting Xcode
  • Cleaning the project
  • Touching the (App)_Prefix.pch file
  • All of the above
  • Turning off precompiled headers (but then I get lots of other errors)
  • Googling for solutions not listed above

I am now out of ideas. Help!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Julian Gold
  • 1,246
  • 2
  • 19
  • 40
  • 1
    I found a similar error on SO here: http://stackoverflow.com/q/13369946/558933 . Can you check if any of the answers helps you. – Robotic Cat Mar 21 '14 at 15:29
  • Thanks @RoboticCat I saw that one. It's a Ruby related question I think so not all the suggestions are applicable. I have tried as much as I can (inasmuch as the problem is with my project's pch, not a dependent project). – Julian Gold Mar 21 '14 at 15:42
  • 1
    This may let you build it http://stackoverflow.com/questions/4728225/is-it-ok-to-remove-prefix-pch-file-from-the-xcode-project – Nick Mar 21 '14 at 15:52
  • Thanks Nick - well when I turn the pch compilation off, I certainly get rid of that error, only fir it to be replaced with another different one ("cannot specify -o when generating multiple output files"). That looks like another rabbit-hole to chase down! – Julian Gold Mar 21 '14 at 16:05
  • OK - question time: Can you tell us about how the project is structured? Are there any libraries included? Is there anything non-standard about the `pch`? Are you compiling on the command line versus inside Xcode? Have you checked the build settings of the project and targets? Can you test compile the `pch` by hand (http://clang.llvm.org/docs/PCHInternals.html)? – Robotic Cat Mar 21 '14 at 16:18
  • Hi @RoboticCat we are just trying to understand the structure - we are new to the Mac/iOS/Xcode game so it's a bit hard to pick apart. There are 4 targets in the project. There are quite a few frameworks, libz.dylib, TestFlightSDK and VaxVoIP but they are static libraries. It also uses libPods.a which shows up in red?Nothing out of the ordinary as far as I can tell but I can't tell very far if you get my drift? To manually compile I will have to recreate the command line for ProcessPCH? This includes a reference to the missing file. So almost certainly will fail! – Julian Gold Mar 21 '14 at 16:43
  • 1
    A `red static library` means a `missing file or directory`. I think `libPods.a` is CocoaPods which is related to those answers I posted. I would strongly urge you to re-read those solutions and I suspect that you need to uninstall then re-install CocoaPods (a recent version). Make a backup first. – Robotic Cat Mar 21 '14 at 17:29
  • 1
    As an aside, if you are new to Mac/iOS/Xcode then you have a bit of a learning curve. And if you've picked up a complex CocoaPods project then you should read the website for info:http://cocoapods.org .CocoaPods is written in Ruby. – Robotic Cat Mar 21 '14 at 17:33

2 Answers2

0

Perhaps hold down option, and from the Product menu, choose "Clean build folder..."

Bart van Kuik
  • 4,704
  • 1
  • 33
  • 57
0

Well after getting a friend in to help, the code builds. It was no one thing. Chief amongst the evils were:

  • Xcode 5.1 throwing errors on unrecognised flags
  • The DerivedData folder needed to be relative but was defaulting to, er, default.
  • I had unzipped the project archive on PC to copy on my Mac; this had broken all the symbolic links (ouch!)
  • The project linked to static some .a files that were ARM only, so couldn't be built for the emulator
  • Links to a subproject was broken and had to be removed and re-added
  • The libCocoaPods.a had to be rebuilt and re-added

Hurrah. Wouldn't have spotted some of those without help. Welcome to the machine! Now it turns out that Apple have messed up my iOS developer licence and so I have to send them Photo ID to prove I am who I am. Joy...

Julian Gold
  • 1,246
  • 2
  • 19
  • 40