CHDataStructures.framework 无法在 Xcode 4 中为 iOS 进行编译
我下载了CHDataStructures源代码(r709),并尝试在xCode 4下编译iOS静态库。编译时它抱怨:
任何人都可以给我一些如何编译它的想法吗?
I downloaded CHDataStructures source code (r709), and tried to compile the iOS static library under xCode 4. It complained when compiling:
Can anyone give me some ideas how to compile it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为该框架的作者,当 Dave DeLong 通过我的方式传递此链接时,我很感兴趣。
事实证明,这不是由于 Xcode 4 造成的,而是由于 iOS 4.3 SDK 中的更改(顺便说一下,10.7 SDK 也是如此)。我将 OBJC_EXPORT 宏与 __attribute__((visibility("hidden"))) 一起使用(为此我定义了一个名为 HIDDEN 的宏)。直到 4.3/10.7 更改了
/usr/include/objc/objc-api.h
中OBJC_EXPORT
宏的定义时,这才成为问题...以前,它是定义为 OBJC_EXTERN,但现在定义为 OBJC_EXTERN OBJC_VISIBLE,解析为 OBJC_EXTERN __attribute__((visibility("default")))。因此,我使用 HIDDEN OBJC_EXPORT 的声明突然开始解析为:
基本上,相反的可见性属性是错误的原因。 (准备好,战斗!)
我刚刚测试并提交了一个修复程序,将
HIDDEN OBJC_EXPORT
替换为HIDDEN
。显然这些符号无论如何都不需要声明为 extern,因为它无需这些宏即可工作。因此,您的问题的简短答案是:更新到修订版 710。;-)
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 calledHIDDEN
). This wasn't a problem until 4.3/10.7 changed the definition ofOBJC_EXPORT
macro in/usr/include/objc/objc-api.h
...Previously, it was defined as
OBJC_EXTERN
, but now it's defined asOBJC_EXTERN OBJC_VISIBLE
, which resolves toOBJC_EXTERN __attribute__((visibility("default")))
. Thus, my declarations that usedHIDDEN OBJC_EXPORT
suddenly began resolving to: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
withHIDDEN
. Apparently those symbols didn't need to be declared asextern
anyway, because it works without those macros.So, the short answer to your question is: update to revision 710. ;-)