CHDataStructures.framework won't compile for iOS in Xcode 4

后端 未结 1 676
终归单人心
终归单人心 2021-01-21 07:11

I downloaded CHDataStructures source code (r709), and tried to compile the iOS static library under xCode 4. It complained when compiling:

相关标签:
1条回答
  • 2021-01-21 08:10

    As the author of the framework, I was intrigued when Dave DeLong passed this link my way.

    Turns out this isn't due to Xcode 4, it's due to changes in the iOS 4.3 SDK (and incidentally, the 10.7 SDK too). I was using the OBJC_EXPORT macro with __attribute__((visibility("hidden"))) (for which I defined a macro called HIDDEN). This wasn't a problem until 4.3/10.7 changed the definition of OBJC_EXPORT macro in /usr/include/objc/objc-api.h...

    Previously, it was defined as OBJC_EXTERN, but now it's defined as OBJC_EXTERN OBJC_VISIBLE, which resolves to OBJC_EXTERN __attribute__((visibility("default"))). Thus, my declarations that used HIDDEN OBJC_EXPORT suddenly began resolving to:

    __attribute__((visibility("hidden"))) OBJC_EXTERN __attribute__((visibility("default")))
    

    Basically, the opposing visibility attributes were the cause of the errors. (Ready, fight!)

    I've just tested and committed a fix which replaces HIDDEN OBJC_EXPORT with HIDDEN. Apparently those symbols didn't need to be declared as extern anyway, because it works without those macros.

    So, the short answer to your question is: update to revision 710. ;-)

    0 讨论(0)
提交回复
热议问题