为 IOS 编译 ffmpeg(R_ABS reloc 错误)

问题描述 投票:0回答:1

我一直在尝试编译适用于 IOS 的 ffmpeg 库。如果我使用 --disable-asm,我可以让它工作,但为了性能,我想在启用它们的情况下进行构建。

这是我使用过的众多配置命令之一。

./configure --prefix=armv7 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc" --extra-cflags="-arch armv7 -miphoneos-version-min=5.0" --extra-ldflags="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0" --arch=arm --cpu=cortex-a9 --disable-everything --enable-pic --enable-static --disable-shared

它编译得很好,但是当我尝试在我的项目中链接它时,我得到:

ld:在 /ffmpeg/libavcodec/libavcodec.a(simple_idct_armv5te.o) 中,在 _TEXT,_text reloc 0 中:R_ABS reloc 但在架构 armv7 的目标地址处没有绝对符号

我是否缺少一些关键选项?我尝试过使用 1.0 版本和最新的 git 版本的 ffmpeg。

ios iphone ffmpeg linker
1个回答
0
投票

我遇到了同样的问题。 我的解决方案是切换到较新的gas-preprocessor.pl,可以在这里找到:https://github.com/mansr/gas-preprocessor

只需安装它来代替您当前使用的旧版本即可。

© www.soinside.com 2019 - 2024. All rights reserved.