磕磕碰碰,Xcode6.1编译x264库

此篇文章的环境:xcode6.1 sdk8.1
编译的版本:真机armv7 arm64 


这两天在编译x264的库,按照网上的方法

一,x264库的编译
首先到http://www.videolan.org/developers/x264.html下载x264的库,然后解压。

打开shell,进入x264的目录,执行如下语句

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system' --enable-pic

make,make install;

发现,出现No working C compiler found.错误,原因是 没有在/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 下面找到gcc,因为上面的语句是 在xcode4.2编译的,现在xcode6.1了,那个路径下没有gcc了,后来根据查找各种资料,各种尝试,希望遇到同样问题的不要走弯路,最后的命令如下:

armv7

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system' --enable-pic --disable-asm

运行完了以后再运行make就可以找到libx264.a库

arm64

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64 -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system' --enable-pic --disable-asm

运行完了以后再运行make就可以找到libx264.a库
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值