7

I'm trying to compile sources with Xcode 4.6, for 32bit architecture, but getting this error:

error: -fobjc-arc is not supported on platforms using the legacy runtime
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

What's wrong?

Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
rdshck
  • 592
  • 1
  • 5
  • 12

2 Answers2

14

You're mixing ARC (automatic reference counting) with the older Objective-C 1.0 runtime, which does not support ARC.

32-bit apps on OSX, automatically use the 1.0 Runtime, so you'll have to disable ARC for your project, and use Manual Reference Counting.

Alan
  • 45,915
  • 17
  • 113
  • 134
2

This problem recently resurfaced because Xcode 5 removes the ARCHS parameter - if you let it. But if you have a build server with Xcode 4 this defaults there to building 32 and 64 bit, which fails if you have ARC enabled.

See my writeup for a more detailed explanation.

Cocoanetics
  • 8,171
  • 2
  • 30
  • 57