Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libobjc.A.dylib compile error on iOS 4.3

Tags:

xcode

ios

I'm having a compiling error in iOS Simulator 4.3 I can't actually figure it out, The error I get is:

dyld: lazy symbol binding failed: Symbol not found: _objc_retain
  Referenced from: /Users/ben/Library/Application Support/iPhone Simulator/4.3.2/Applications/75915A97-7C3D-489A-B7B0-7B6895A4B584/AppName.app/AppName
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libobjc.A.dylib

dyld: Symbol not found: _objc_retain
  Referenced from: /Users/ben/Library/Application Support/iPhone Simulator/4.3.2/Applications/75915A97-7C3D-489A-B7B0-7B6895A4B584/AppName.app/AppName
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libobjc.A.dylib

Note:
The library being referenced (libobjc.A.dylib) is actually in the 'Expected Place' The code works fine on an iOS5 device, and in iOS5 Simulator.

like image 845
oberbaum Avatar asked Nov 13 '11 13:11

oberbaum


2 Answers

Add -fobjc-arc in Build Settings => Other Linker Flags (OTHER_LDFLAGS) for the different configurations

like image 131
Jerapong Nampetch Avatar answered Oct 05 '22 04:10

Jerapong Nampetch


This problem occurs if you use a library that uses ARC and want to build/run on older iOS 4 devices.

In Build Settings => Other Linker Flags

  • Add -fobjc-arc
  • If yet not solved, then add -weak_library /usr/lib/libobjc.A.dylib
like image 31
Md Mahbubur Rahman Avatar answered Oct 05 '22 04:10

Md Mahbubur Rahman