ios - 使用最新的 iOS SDK 编译时,libcurl 在 iOS 9 上崩溃

标签 ios c curl libcurl ios10

iOS 10系统库中有clock_gettime函数。

当我在最新的 iOS SDK 上编译 curl 时,configure 脚本总是定义 HAVE_CLOCK_GETTIME_MONOTONIC(但我定义了 -miphoneos-version-min=8.0 !),导致在以前的 iOS 版本上崩溃。在 dylib stub_binder 上崩溃看起来像 EXC_BREAKPOINT (EXC_ARM_BREAKPOINT)。调用 curlx_tvnow() 时发生崩溃。使用 HAVE_CLOCK_GETTIME_MONOTONIC 它调用 clock_gettime,这在 iOS 10 之前的版本中不存在。

-miphoneos-version-min 小于 10.0 时,有没有办法禁用 HAVE_CLOCK_GETTIME_MONOTONIC

最佳答案

我已经通过添加 CFLAGS= CFLAGS + "-miphoneos-version-min=8.0 -Werror=partial-availability" 编译了 CURL( https://curl.haxx.se/download.html ),它对我来说工作正常。

关于ios - 使用最新的 iOS SDK 编译时,libcurl 在 iOS 9 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39972455/

相关文章:

ios - 何时释放 transient NSString StringWithFormat?

ios - 在 UIScrollView 中添加和定位 UIButtons 数组

c - 读取 argv[] 中的原始字节

c++ - 如何获得连接路由中的跃点?

windows - Windows 7 命令提示符的代理设置

iphone - 如何在 MKMapView 上绘制当前位置到所需位置之间的路线?

ios - 通过 Segue 将缓存图像传递到 DetailViewController

c - C 中的 void 类型

c - #pragma align 如何工作?

linux - Linux 下的curl命令报错