xcode3.2.6,sdk4.3,ffmpeg0.10.2,编译

只能编译armv7 and i386

编译ffmepg模拟器版本i386
1. 到https://github.com/gabriel/ffmpeg-iphone-build下载ffmpeg-iphone-build
2.先将gas-preprocessor.pl拷贝到/usr/sbin/目录中。
3.到ffmpeg官网上下载ffmpeg源码
4.在终端下定位到ffmpeg的目录运行
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-encoders --enable-cross-compile --disable-decoders --disable-armv5te --enable-decoder=h264 --enable-pic --cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' --extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk --target-os=darwin --arch=i386 --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386'
5.输入make命令
6.将libavcodec.a,libavdevice.a,libavformat.a,libavutil.a,libswscale.a到对应的目录下拷贝出来。

附注:

//编译日志
在加个 i386的 错误
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first


解决:
before this cleanAll build then
In xcode go to Project > set active executable > appname - Iphone 4.0 simulator
then open simulator then go to Hardware > version > 4.0.2
then double click urapptarget and in build tab change "ios deployment target = 4.0"
now run in simulator it will work 

//遇到sh^M 问题解决:

最近在使用CT++这个软件时遇到这样一个问题:这个软件是在FREEBSD下开发的,虽然提供了C语言源程序,但程序在Visual Studio 2003下编译出现错误。检查原因,主要是因为源程序都是UNIX格式,每行的回车都是用一个0x0a字符表示的,而在WINDOWS/DOS下每行的回车都是用0x0d0a两个字符表示的,而该程序注释为俄文,影响了VS2003的处理,把大量的程序代码都当作注释了,所以编译就不能通过。要编译通过,必须先将UNIX文本格式转换为DOS格式的。UltraEdit的FILE菜单中提供了对单个文件进行这种转换的能力,但是一次只能转换一个文件,比较麻烦。经过一番研究,终于找到了一个批量实现转换的方法。在UE中选择Search | Search in files菜单,在Find框中填写^n(表示UNIX文件中的回车换行符号),在Replace with中输入^p(表示DOS文件中的回车换行符号),如下图所示。这样就可以实现批量替换了。

 

编译armv7版本:

./configure \
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--enable-pic \
--enable-cross-compile \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-asm \
--disable-encoders \
--disable-decoders \
--enable-decoder=h264 \
--disable-doc

转载于:https://www.cnblogs.com/rothwell/archive/2012/04/17/2454584.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值