CHDataStructures.framework 无法在 Xcode 4 中为 iOS 进行编译

发布于 2024-10-26 00:29:24 字数 167 浏览 1 评论 0原文

我下载了CHDataStructures源代码(r709),并尝试在xCode 4下编译iOS静态库。编译时它抱怨:

Xcode build错误

任何人都可以给我一些如何编译它的想法吗?

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

Xcode build errors

Can anyone give me some ideas how to compile it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过期以后 2024-11-02 00:29:24

作为该框架的作者,当 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.hOBJC_EXPORT 宏的定义时,这才成为问题...

以前,它是定义为 OBJC_EXTERN,但现在定义为 OBJC_EXTERN OBJC_VISIBLE,解析为 OBJC_EXTERN __attribute__((visibility("default")))。因此,我使用 HIDDEN OBJC_EXPORT 的声明突然开始解析为:

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

基本上,相反的可见性属性是错误的原因。 (准备好,战斗!)

我刚刚测试并提交了一个修复程序,将 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 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. ;-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文