Compilation error libobjc.A.dylib on iOS 4.3

I have a compilation error in iOS Simulator 4.3. I can’t figure it out. The error I am getting 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 referenced (libobjc.A.dylib) is actually located in the "Expected Place", the Code works fine on the iOS5 device and iOS5 Simulator.

+6
source share
2 answers

Add -fobjc-arc in the build settings => Other linker flags ( OTHER_LDFLAGS ) for different configurations

+28
source

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

In build settings => Other linker flags

  • Add -fobjc-arc
  • If this has not been decided yet, add -weak_library /usr/lib/libobjc.A.dylib
+1
source

Source: https://habr.com/ru/post/901379/


All Articles