ios - 使用 FFmpeg pod 时全局命名空间中没有名为 'clock' 的成员

标签 ios xcode ffmpeg cocoapods

我的应用程序(iOS 7+、Xcode 6)使用 CocoaPods 作为其依赖项。其中一个依赖项是 FFmpeg .

当我构建我的应用程序时,我遇到了几个类似的问题,例如

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:60:9: No member named 'clock' in the global namespace; did you mean 'flock'?

我了解到这是因为 FFmpeg 在 libavutil 子文件夹中包含 time.h 文件。此 time.h 对编译器隐藏系统 time.h,从而隐藏错误。

我尝试手动将 FFmpeg 的 time.h 重命名为其他名称,这有帮助。现在我想自动执行此操作,并以一种能够在下一次“pod 更新”中继续存在的方式。

我试图将 libavutil 添加到 Sub-Directories to Exclude In Recursive Searches 但这根本没有帮助。

我试图从 Header Search Paths 中删除“${PODS_ROOT}/Headers/Public/FFmpeg/libavutil”,但它也没有帮助。

我知道可以在他的 Podfile 中使用 prepare_commandpost_install Hook ,但不幸​​的是,我不知道这些对我的情况是否有帮助。

那么,如何从 header 搜索路径中排除 FFmpeg pod 的 libavutil 中的 time.h(我不介意重命名甚至删除 time.h)?

最佳答案

对于与 ffmpeg 的 time.h 有相同问题的人:

你可以搜索系统的time.h并将其手动包含在 ffmpeg 的 time.h 中:

打开 ffmpeg 的 time.h (在 libavutil 中)并插入 #include </usr/include/time.h>一开始。

当然这只是一个懒惰的解决方法,但它是同时包含 time.h 的简单方法标题。

关于ios - 使用 FFmpeg pod 时全局命名空间中没有名为 'clock' 的成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31269793/

相关文章:

ios - 快速设置 UiCollectionView 中单元格的选定颜色

ios - TableView 在executeFetchRequest 后未重新加载

xcode - dyld : Library not loaded. 原因:找不到合适的图像

ios - 在不提交的情况下更改对象的属性

iphone - 点击手势不适用于 UIimageview

ios - 错误 :Storyboard doesn't contain a view controller with identifier 'jailBrokenViewController' '

FFMPEG - 我如何获得这些重叠视频的边界

FFMPEG 脚本在每个剪辑的开头和结尾添加 1 秒淡入淡出

c - 在 C 中使用 x264 和 AVCodec 编码 RGB 帧

ios - SNS Push Notification Service 多线程发布API 2秒发布10万条消息