首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试为armv6和arv7架构的iPhoneOS平台编译FFMPEG库

尝试为armv6和arv7架构的iPhoneOS平台编译FFMPEG库
EN

Stack Overflow用户
提问于 2013-04-05 19:27:45
回答 1查看 3.2K关注 0票数 4

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

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

对于i386(无错误):

代码语言:javascript
复制
./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:

代码语言:javascript
复制
./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命令,我得到了这个错误:

代码语言:javascript
复制
/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.

所以请给我一个可行的解决方案。为什么它不工作?或者我需要更新什么。谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-06-06 05:17:47

我意识到这个问题大约在2.5个月前被问过,所以发问者可能已经离开了,但我在寻找相同问题的答案时遇到了这个问题。所以,希望这能对外面的人有所帮助!

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

具体地说,我试图运行:

代码语言:javascript
复制
./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“(在上面的路径中引用了它)。

将脚本更改为以下内容有效:

代码语言:javascript
复制
./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 

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15832754

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档