Xcode not compiling any project? 'clang failed with exit code 255'

Solution 1:

I just had that same error, same situation(the code worked totally fine, then suddenly has that error message). For me I just closed the simulator and opened it again then xCode does not complain anymore.

Have you tried to run your code in device?

Solution 2:

This is happening because your OS X install is running into the per-user process limit. And that's happening because XCode doesn't always cleanly kill your process at the end of a debugging session.

On my machine, I have 709 processes allowed per user:

El Smeg:~$ sysctl kern.maxprocperuid
kern.maxprocperuid: 709

Looking at the number of zombied processes on my machine:

El Smeg:~$ ps aux | grep \(GridView\) | wc -l
 608

So you can see that I'm pretty close to the per-user process limit just due to XCode leaving zombie processes around.

Unfortunately, I don't see a good way to kill these off. kill -9 doesn't work. Rebooting seems to be the only fix aside from temporarily raising your per-process limit, which isn't really a fix. You can't kill the parent process because that's launchd and killing that is pretty much equivalent to a reboot anyway.

Solution 3:

For me, I just had to reboot (OS X 10.7, Xcode 4.5).

Solution 4:

Roboot your MAC, Launch xcode and before doing anything clean up your project (cmd+shift+k).

Solution 5:

I have had this a few times. The simplest way I have found to fix it is just to close the simulator.