【问题标题】:Trying to compile the FFMPEG libraries for iPhoneOS platform with armv6 and arv7 architecture尝试为具有 armv6 和 arv7 架构的 iPhoneOS 平台编译 FFMPEG 库
【发布时间】:2013-04-05 11:27:45
【问题描述】:

我正在尝试为具有 arm7 架构的 IOS 平台编译 FFMPEG 库。我从 http://www.ffmpeg.org 下载了 FFMPEG 库。

我成功地为 iPhoneSimulator 的 i386 架构构建了静态库。但我需要 iPhoneOS 的库。使用配置命令我得到一个错误。以下是我的命令详细信息。

对于 i386(无错误):

./configure  --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network  --disable-everything  --enable-protocol=file --enable-demuxer=mov  --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb   --arch=i386 --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"

对于 armv7:

./configure  --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network  --disable-everything  --enable-protocol=file --enable-demuxer=mov  --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb   --arch=armv7 --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=cortex-a9 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"

对于 Arm7 的上述命令,我收到此错误:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from SVN.

所以请给我一个可能的解决方案。为什么它不起作用?还是我需要更新任何东西。谢谢。

【问题讨论】:

标签: ios objective-c linux video ffmpeg


【解决方案1】:

我意识到这个问题是在大约 2.5 个月前被问到的,所以提问者可能已经继续前进,但我在寻找同一问题的答案时遇到了这个问题。所以,希望这对那里的人有所帮助!

我真正需要做的就是验证我使用的所有路径实际上都指向存在的东西。

具体来说,我正在尝试运行:

./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/gcc" \
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.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 --enable-pic

^ 来自http://www.tangentsoftworks.com/2012/11/12/how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/

当我无法让它工作时,我决定停止偷懒,并实际检查了路径中列出的目录:任何以“/Applications/...”开头的目录。 我发现我没有安装“iPhoneOS6.0.sdk”(它在上面的路径中引用)。

将脚本更改为此有效:

./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.1.sdk" \
--target-os=darwin --cc="/applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.0" \
--extra-ldflags="-arch armv7 -isysroot /applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.0" \
--arch=arm --cpu=cortex-a9 --enable-pic 

简而言之,只需仔细检查您的路径。希望对您有所帮助!

【讨论】:

  • 感谢您的回答。现在我无法再次检查代码,因为代码不可用。但我想提一件事,我已经尝试过每个 sdk 文件,即 6.0、6.1 和其他文件,我也在多个系统上尝试过。但我还是做不到。
  • 让我知道您是否/当您尝试上述方法、工作(至少对我而言)、建立例行程序。希望你能成功。另外,您是否真的查看了您的路径,以便了解您的计算机上实际存在哪些 SDK?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-02-06
  • 1970-01-01
  • 2014-09-01
  • 2018-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多