我正在尝试存档一个使用 BBHTTP 库(包括 libCurl)的 iOS 7 应用程序。内置错误:
curl_rule_01 declared as an array with negative size
curlrules.h 中错误的代码行:
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
我已经在 curlbuild.h 中尝试了这些更改
#define CURL_SIZEOF_LONG 4
到
#define CURL_SIZEOF_LONG 8`
由于 64 位,但它没有改变任何东西。
最佳答案
注意:您不能在 curlbuild.h
中更改这些宏!此 header 在配置时生成,它记录(除其他事项外)目标架构。
如果您查看 BBHTTP 提供的预构建静态库,您会发现它仅针对 ARMv7
和 ARMv7s
架构:
$ otool -fV External/libcurl.iOS/libcurl.iOS.appstore.a | grep Archive
Archive : External/libcurl.iOS/libcurl.iOS.appstore.a (architecture armv7)
Archive : External/libcurl.iOS/libcurl.iOS.appstore.a (architecture armv7s)
这些是 32 位架构。请引用BBHTTP Dependencies有关如何编译此静态库的更多详细信息。
如果您使用 iOS 7 作为部署目标构建 iOS 应用程序,您肯定会在build设置中配置默认架构。这些默认值包括一个 32 位切片和一个 64 位切片:
因此在这种情况下,您必须包括一个 libcurl fat 静态库,它还包含一个 64 位切片(又名 arm64
)。
curl iOS build scripts来自 BBHTTP 的作者可能对你有帮助。否则请引用Nick Zitzmann libcurl pre-built .
关于objective-c - 构建 xcode 5 iOs 7 时出现 "curl_rule_01 declared as an array with negative size"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20188443/