Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C ARC and Legacy Runtime compiling error

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?

like image 651
rdshck Avatar asked Mar 05 '13 02:03

rdshck


2 Answers

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.

like image 166
Alan Avatar answered Nov 05 '22 04:11

Alan


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.

like image 37
Cocoanetics Avatar answered Nov 05 '22 04:11

Cocoanetics