这是我的错误:(较新版本的ffmpeg)
dyld: Library not loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
Referenced from: /Users/me/path/to/lib/libavcodec.dylib
Reason: Incompatible library version: libavcodec.dylib requires version 64.0.0 or later, but ApplicationServices provides version 1.0.0
我已经阅读了有关SO的问题,说你需要链接ApplicationServices.framework ......我已经完成了,它没有任何区别......
我搜索了该框架的其他版本:
$ mdfind ApplicationServices.framework
/System/Library/Frameworks/ApplicationServices.framework
只有一个......
然后检查框架......
$ otool -L /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
...
和libavcodec
otool -L ../lib/libavcodec.dylib
../lib/libavcodec.dylib:
libavcodec.dylib (compatibility version 56.0.0, current version 56.60.100)
@loader_path/libswresample.dylib (compatibility version 1.0.0, current version ...
...
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 64.0.0, current version 600.0.0)
我正在用-mmacosx-version-min=10.7
所以也许是工具链中的一个错误?
编译器:
clang -v
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
接头:
ld -v
@(#)PROGRAM:ld PROJECT:ld64-253.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: Apple LLVM 7.0.2 (clang-700.1.81)
答案 0 :(得分:0)
它似乎是clang中的一个错误,我重新安装了Xcode 6.x,现在libavcodec的otool输出是:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 600.0.0)
仍然与库本身的输出不匹配...但它的兼容性版本足够低......我会看看是否可以隔离并提交错误...