ld: duplicate symbol _objc_retainedObject on iOS 4.3 , but not on iOS 5.0

后端 未结 2 781
囚心锁ツ
囚心锁ツ 2021-02-07 21:48


Some background - I\'ve built a custom Framework using Diney\'s guide at http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/

Its built for both armv

2条回答
  •  醉酒成梦
    2021-02-07 22:20

    I'm struggling with the same problem. The workaround is so set the deployment target of your framework to iOS5 (check if that doesn't make other problems though).

    Then you must use ARC in the master project if targeting iOS4, else libarclite will be missing. My solution will be to supply two frameworks, depending if they use ARC or not.

    Here's two links to Apple's dev forum with a little bit more info: https://devforums.apple.com/message/539344#539344

    https://devforums.apple.com/message/588316#588316

    Update: There is a better way. Just build your static library with iOS5 minimum target, and manually add /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/arc/libarclite_iphoneos.a (and /Developer/usr/lib/arc/libarclite_iphonesimulator.a) if your project is not using ARC and needs iOS4-support.

    Update 2: Actually, just use the linker flag -fobjc-arc ; this will link libarclite with the library if it's not already in there. Best solution.

提交回复
热议问题