ios版本编译|ios 怎么配置编译ffmpeg

A. ios 怎么配置编译ffmpeg

MAC OS X Mountain Lion 10.8.3、 XCode 5.1二、编译FFMpeg1、下载ffmpeg2.2.5版本代码,并解压。2、下载并解压gas-preprocessor.pl (附件中有,zip格式,因网易博客不能上传zip后缀的文件,故加了个.rar)在终端中使用cp命令将它复制到 /usr/sbin/目录,并赋予可执行权限。sudo cp -f gas-preprocessor/gas-preprocessor.pl /usr/sbin/chmod +x /usr/sbin/gas-preprocessor.pl3、在ffmpeg目录下创建一个config.sh脚本#!/bin/bashSDKVERSION="7.1"ARCHS="armv7 armv7s i386"DEVELOPER=`xcode-select -print-path`cd "`dirname \"$0\"`"REPOROOT=$(pwd)# where we will store intermediary buildsINTERDIR="${REPOROOT}/built"mkdir -p $INTERDIR######################################### Exit the script if an error happensfor ARCH in ${ARCHS}doif [ "${ARCH}" == "i386" ];thenPLATFORM="iphoneSimulator"EXTRA_CONFIG="–arch=i386 –disable-asm –enable-cross-compile –target-os=darwin –cpu=i386"EXTRA_CFLAGS="-arch i386"EXTRA_LDFLAGS="-I${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk/usr/lib"elsePLATFORM="iPhoneOS"EXTRA_CONFIG="–arch=arm –target-os=darwin –enable-cross-compile –cpu=cortex-a9 –disable-armv5te"EXTRA_CFLAGS="-w -arch ${ARCH}"fimkdir -p "${INTERDIR}/${ARCH}"./configure –prefix="${INTERDIR}/${ARCH}" \ –disable-neon \ –disable-armv6 \ –disable-armv6t2 \ –disable-ffmpeg \ –disable-ffplay \ –disable-ffprobe \ –disable-ffserver \ –disable-iconv \ –disable-bzlib \ –enable-avresample \ –sysroot="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" \ –cc="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" \ –as='/usr/local/bin/gas-preprocessor.pl' \ –extra-cflags="${EXTRA_CFLAGS} -miphoneos-version-min=${SDKVERSION}" \ –extra-ldflags="-arch ${ARCH} ${EXTRA_LDFLAGS} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk -miphoneos-version-min=${SDKVERSION}" ${EXTRA_CONFIG} \ –enable-pic \ –extra-cxxflags="$CPPFLAGS -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"make && make install && make cleandonemkdir -p "${INTERDIR}/universal/lib"cd "${INTERDIR}/armv7/lib"for file in *.adocd ${INTERDIR}xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$fileecho "Universal $file created."donecp -r ${INTERDIR}/armv7/include ${INTERDIR}/universal/

B. 如何在iOS下编译librtmp

编译librtmp需要先编译openssl,因为librtmp依赖openssl首先编译openssl:把以下内容保存为shell脚本:#!/bin/shVERSION="1.0.1h" #指明openssl的版本信息,比如下载的是openssl-1.0.1h.tar.gz那么对于就填写1.0.1hSDKVERSION="7.1" #指明ios sdk的版本号,目前最新的是7.1,不清楚的同学可以 ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ 一下看看自己的iPhoneOS7.1.sdk是不是7.1CURRENTPATH=`pwd`ARCHS="i386 armv7 armv7s arm64"BUILDPATH="${CURRENTPATH}/build"LIBPATH="${CURRENTPATH}/lib"INCLUDEPATH="${CURRENTPATH}/include"SRCPATH="${CURRENTPATH}/src"LIBSSL="libssl.a"LIBCRYPTO="libcrypto.a"DEVELOPER=`xcode-select -print-path`if [ ! -d "$DEVELOPER" ]; thenecho "xcode path is not set correctly $DEVELOPER does not exist (most likely because of xcode > 4.3)"echo "run"echo "sudo xcode-select -switch <xcode path>"echo "for default installation:"echo "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer"exit 1fiset -eif [ ! -e openssl-${VERSION}.tar.gz ]; thenecho "Downloading openssl-${VERSION}.tar.gz"curl -O http://www.openssl.org/source/openssl-${VERSION}.tar.gzelseecho "Using openssl-${VERSION}.tar.gz"# Remove the source directory if already existrm -rf "${SRCPATH}/openssl-${VERSION}"fimkdir -p "${SRCPATH}"mkdir -p "${BUILDPATH}"mkdir -p "${LIBPATH}"mkdir -p "${INCLUDEPATH}"tar zxf openssl-${VERSION}.tar.gz -C "${SRCPATH}"cd "${SRCPATH}/openssl-${VERSION}"LIBSSL_REPO=""LIBCRYPTO_REPO=""for ARCH in ${ARCHS}doif [ "${ARCH}" == "i386" ];thenPLATFORM="iPhoneSimulator"elsesed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"PLATFORM="iPhoneOS"fiexport CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"export BUILD_TOOLS="${DEVELOPER}"echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"echo "Please stand by…"export CC="${BUILD_TOOLS}/usr/bin/gcc -arch ${ARCH}"OUTPATH="${BUILDPATH}/openssl-${PLATFORM}${SDKVERSION}-${ARCH}.sdk"mkdir -p "${OUTPATH}"LOG="${OUTPATH}/build-openssl-${VERSION}.log"if [[ "$VERSION" =~ 1.0.0. ]]; then./Configure BSD-generic32 –openssldir="${OUTPATH}" > "${LOG}" 2>&1else./Configure iphoneos-cross –openssldir="${OUTPATH}" > "${LOG}" 2>&1fi# add -isysroot to CC=sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/Platforms/${PLATFORM}.platform/Developer/SDKs/${CROSS_SDK} -miphoneos-version-min=7.0 !" "Makefile"make >> "${LOG}" 2>&1make install >> "${LOG}" 2>&1make clean >> "${LOG}" 2>&1LIBSSL_REPO+="${OUTPATH}/lib/${LIBSSL} "LIBCRYPTO_REPO+="${OUTPATH}/lib/${LIBCRYPTO} "doneecho "Build library…"lipo -create ${LIBSSL_REPO}-output ${LIBPATH}/${LIBSSL}lipo -create ${LIBCRYPTO_REPO}-output ${LIBPATH}/${LIBCRYPTO}cp -R ${BUILDPATH}/openssl-iPhoneSimulator${SDKVERSION}-i386.sdk/include/openssl ${INCLUDEPATH}/echo "Building done."echo "Cleaning up…"rm -rf ${SRCPATH}/openssl-${VERSION}echo "Done."保存脚本,添加脚本的执行权限(chmod +x 脚本名称)运行脚本可以编译成功的,如果失败,可以以打开那个log文件,查看失败原因。编译成功以后,把lib文件和include拷贝到你的librtmp目录(可以新建一个空得librtmp目录),在librtmp目录里面同样写一个shell脚本,脚本如下:#!/bin/shSDKVERSION="7.1" #这里跟openssl的地方是一个意思CURRENTPATH=`pwd`ARCHS="i386 armv7 armv7s arm64"LIBPATH="${CURRENTPATH}/lib" #这里就是刚才拷贝过来的目录,不要修改,因为librtmp最后生成的也放到了这个下面INCLUDEPATH="${CURRENTPATH}/include" #这里就是刚才拷贝过来的目录,不要修改,因为librtmp最后生成的也放到了这个下面LIBRTMPREPO="git://git.ffmpeg.org/rtmpmp"BUILDPATH="${CURRENTPATH}/build"SRCPATH="${CURRENTPATH}/src"LIBRTMP="librtmp.a"DEVELOPER=`xcode-select -print-path`if [ ! -d "$DEVELOPER" ]; thenecho "xcode path is not set correctly $DEVELOPER does not exist (most likely because of xcode > 4.3)"echo "run"echo "sudo xcode-select -switch <xcode path>"echo "for default installation:"echo "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer"exit 1fi# Check whether openssl has already installed on the machine or not.# libcrypt.a / libssl.aset -eecho 'Check openssl installation'if [ -f "${LIBPATH}/libcrypto.a" ] && [ -f "${LIBPATH}/libssl.a" ] && [ -d "${INCLUDEPATH}/openssl" ]; thenecho 'Openssl for iOS has already installed, no need to install openssl'elseecho 'Openssl for iOS not found, will install openssl for iOS'./build-libssl.shecho 'Succeeded to install openssl'fi# Download librtmp source code from git repository# We assuem the user already installed git client.echo 'Clone librtmp git repository'# Remove the directory if already existrm -rf "${SRCPATH}/rtmpmp"git clone ${LIBRTMPREPO} src/rtmpmpcd "${SRCPATH}/rtmpmp/librtmp"LIBRTMP_REPO=""for ARCH in ${ARCHS}doif [ "${ARCH}" == "i386" ];thenPLATFORM="iPhoneSimulator"elsePLATFORM="iPhoneOS"fiexport CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"export BUILD_TOOLS="${DEVELOPER}"echo "Building librtmp for ${PLATFORM} ${SDKVERSION} ${ARCH}"echo "Please wait…"# add arch to CC=sed -ie "s!AR=\$(CROSS_COMPILE)ar!AR=/usr/bin/ar!" "Makefile"sed -ie "/CC=\$(CROSS_COMPILE)gcc/d" "Makefile"echo "CC=\$(CROSS_COMPILE)gcc -arch ${ARCH}" >> "Makefile"export CROSS_COMPILE="${DEVELOPER}/usr/bin/"export XCFLAGS="-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=7.0 -I${INCLUDEPATH} -arch ${ARCH}"if [ "${ARCH}" == "i386" ];thenexport XLDFLAGS="-L${LIBPATH} -arch ${ARCH}"elseexport XLDFLAGS="-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=7.0 -L${LIBPATH} -arch ${ARCH}"fiOUTPATH="${BUILDPATH}/librtmp-${PLATFORM}${SDKVERSION}-${ARCH}.sdk"mkdir -p "${OUTPATH}"LOG="${OUTPATH}/build-librtmp.log"make SYS=darwin >> "${LOG}" 2>&1make SYS=darwin prefix="${OUTPATH}" install >> "${LOG}" 2>&1make clean >> "${LOG}" 2>&1LIBRTMP_REPO+="${OUTPATH}/lib/${LIBRTMP} "doneecho "Build universal library…"lipo -create ${LIBRTMP_REPO}-output ${LIBPATH}/${LIBRTMP}mkdir -p ${INCLUDEPATH}cp -R ${BUILDPATH}/librtmp-iPhoneSimulator${SDKVERSION}-i386.sdk/include/ ${INCLUDEPATH}/echo "Building done."echo "Cleaning up…"rm -rf ${SRCPATH}/rtmpmpecho "Done."保存脚本运行脚本

C. 请教怎么修改makefile 编译ios版本的lib

1.在编译时,引入该库的头文件目录确保通过编译。比如在/usr/local/include:g++ -I/usr/local/include *.c -o a.o2.在链接时,引入该库的二进制文件目录确保通过链接。比如你说的/usr/local/lib:gcc -L/usr/local/lib a.o -o a.out

D. ios文件编译

这是lua。[email protected]@(加密的图片文件,有的用了Lzma压缩)L:grxx__sign_of_g18_enc__(加密的luac脚本文件,有的用了Gzip压缩)__sign_of_g18_enc__(加密的luac脚本文件)

E. 如何编译ios 静态库 release版本

如何用NERO将.ISO文件正确刻录可启动光盘在主界面→复制和备份→将映像刻录到光盘上→在“打开”中找到需要刻录的景像文件→在“刻录编译”中选择“24X”、“光盘一次刻录”、“1”份→点“刻录”。

F. appium ios 02怎么编译

因为是Python版,所以就去Selenium官网下载Python的WebDriver(selenium-2.39.0.tar.gz)https://pypi.python.org/pypi/selenium解压:#gzip -dc selenium-2.39.0.tar.gz | tar xvf -安装:#cd selenium-2.39.0#sudo python setup.py install //sudo依旧是解决Permission的问题-----------这样,WebDriver就安装成功了我照着操作了一遍,版本不同了而已,很顺利:selenium-2.41.0.tar.gzInstalled /Library/Python/2.7/site-packages/selenium-2.41.0-py2.7.eggProcessing dependencies for selenium==2.41.0Finished processing dependencies for selenium==2.41.0admins-Mac:selenium-2.41.0 admin$ which python/usr/bin/pythonadmins-Mac:selenium-2.41.0 admin$ python -VPython 2.7.2编译例子:三,要测试的app测试的是appium提供的TestApp首先,我们需要用xcode编译这个app#cd appium#cd sample-code/apps/TestApp#xcodebuild -sdk iphonesimulator //为了防止iphonesimulator和设置的冲突,没有注明iphonesimulator的版本-----------如果看到** BUILD SUCCEEDED **,这个TestApp就build成功了。操作的时候,留心先进入到项目目录下:admins-Mac:testDemo admin$ cd testadmins-Mac:test admin$ ls -ltotal 0drwxr-xr-x 14 admin staff 476 Apr 22 2013 test[email protected] 5 admin staff 170 Apr 22 2013 test.xcodeprojadmins-Mac:test admin$ xcodebuild -sdk iphonesimulatorBuild settings from command line:SDKROOT = iphonesimulator7.0=== BUILD TARGET test OF PROJECT test WITH THE DEFAULT CONFIGURATION (Release) ===…..我后来运行的时候老是不能指定某个模拟器加载,而老是加载ios7.0,估计就是这个环节的相关配置引起的,以后有空再研究吧。不过也有群友说文档上说会自动启动最高版本的模拟器,这是不可以修改的。算了,反正以后多半使用真机做。看到:** BUILD SUCCEEDED ** 就是编译成功了,在当前目录下就会生成一个build目录,顺带找找app文件在哪里。admins-Mac:test admin$ pwd/Users/admin/Documents/demo/testDemo/testadmins-Mac:test admin$ ls -ltotal 0[email protected] 4 admin staff 136 Apr 15 16:02 builddrwxr-xr-x 14 admin staff 476 Apr 22 2013 test[email protected] 5 admin staff 170 Apr 22 2013 test.xcodeprojadmins-Mac:test admin$ find build|grep test.app$build/Release-iphonesimulator/test.app

G. 老师好,windows编译出iOS版本可以么

先要下好debug 文件与link文件,搜索masm5.0,第一个太平洋之家就有下到。 运行,cmd,以dos命令将路径设置至你的源程序(与masm程序包同一目录下), 键入masm 源程序名 回车,生成obj文件, 键入link 源程序名 回车数次,生成exe文件, 至此,编译完成, 你可以键入 源程序名.exe 来试着运行程序了。

H. mapbox怎么编译ios版本的

方法/步骤从网上下载arm-linux-gcc 4.4.3的源码进入Linux的终端,将当前目录设为arm-linux-gcc的下载目录,输入tar -xzf arm-linux-gcc-4.4.3.tar.gz,将文件解压,解压后会有一个opt的文件夹。在/usr/local/下建立一个名为arm的文件夹,在终端中输入命令:cd /usr/local/,回车,然后再输入命令:mkdir arm,建立arm目录,并修改该文件夹的属性为rwx,输入命令:chmod 777 arm将之前解压得到的opt文件压下的源码,复制到上一步中创建的arm文件夹下,在终端中输入命令:sudo cp -r /opt/FriendlyARM/toolschain/4.4.3 /usr/local/arm到这里已经基本安装好了,到为了避免每次使用arm-linux-gcc时都要输入它所在的完整路径,所以这里我们要修改一下环境变量$PATH。在终端中输入:sudo gedit /etc/profile,打开profile文件,在最后一行加上“export PATH=$PATH:/usr/local/arm/4.4.3/bin”然后保存文件。立即使新的环境变量生效,输入:source /etc/profile。再输入:echo $PATH查看环境变量,如图。如果不成功,则直接重新启动系统,再查看。因为之前我已经安装过了,为了演示,所以图中会有两个/usr/local/arm/4.4.3/bin。最后检查是否安装完成,输入:arm-linux-gcc -v查看版本信息,如果出现以下信息,则说明安装成功。

I. iOS 编译报错怎么办

1.编译iPad真机时,选择了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad.

若编译出现如下错误:

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

则修改 GCC4.2CodeGeneral区域中的ComplieForThumb为非选中.

已经有了开发者证书及私钥后,可直接在越狱的手机上调试.

2. 编译链接时, "_OBJC_CLASS_$_xxx", referenced from:可能需要重新建立某个类的文件.

或者:选择项目名,在detail列表中的target列(显示为一个又圆圈),把这个文件的复选选中,或者再次选中.以把它加入到这个target里面来.

3.在sdk4.0及以上使用RegexKitLite报'captureCount' was not declared in this scope错误,是在非.m文件中使用了它的原因.

4.there is no sdk with the name or path.

从网上down的开源代码,结果运行的时候常出现这样的错,并且在deployment中没有iosdeploymenttarget选项.

尝试 Project/Edit Active Target/ 及 Set Active SDK菜单项,来回切换一下Active Configuration。

5. EXEC_BAD_ACCESS,EXC_BAD_INSTRUCTION错误,意味着这个app有内存管理的问题,一般是因为访问野指针对象造成的。

一个和内存相关的崩溃一般很难定位到源代码,因为这个恶魔可能很早就在程序中做了坏事了。假如一段有问题的代码混乱了内存结构,这样产生的蝴蝶效应可能会在之后很久才表现出来,并且总在不同的地方。所以,若有指针类型出现了不可能的变化,很可能就是因为内存结构被野指针调用混乱了。

修复一些警告后,可能就能预防一些内存错误。警告在左边靠近行号的黄色三角指出一个编译警告,你点击那个黄色的三角形,xcode可能会弹出一个“Fix-it”的建议。

EXC_BAD_ACCESS崩溃不像SIGABRT,将不会得到很明朗的错误消息。然而可以使用一个让人看到曙光的调试工具:Zombies!死亡对象工具。打开这个项目的scheme editor,选择Run 选项,然后选择Diagnosics标签。勾上Enable Zombie Objects选项。当这个zombie工具被启用之后,即使这个对象被释放了,这个对象的内存也不会被清理。所以,那块内存将会被标记为“长生不死的”。假如你试着之后又去使用这块内存,这个app能够意识到你的错误操作,并且app将会抛出“messagesent to daellocated instance”错误并且终止运行。

在工程中加入NSZombieEnabled 环境变量,并设为启用,则在 EXC_BAD_ACCESS 发生时,XCode 的 Console 会打印出问题描述中,设置方法:双击Executables 下的 可执行模组,在弹出窗口中,Variables to be set in the environment,添加 NSZombieEnabled,并设定为 YES,点击选中复选框启用此变量。

可以再加入 MallocStackLogging 来启用malloc记录,以获得更多的提示来帮助定位问题。

在gdb窗口输入 (格式: shell malloc_history <id> <address>) shellmalloc_history1436 0x5f7fcf0, 也可以在终端中去运行 就要去掉以上的shell 指令 如 malloc_history <id> <address>

应该仅当需要调试内存时,才设置上述环境变量。

注意一点:不应该一直启用zombie objects。因为这个工具将永远不会释放内存,只是简单标记一下这个内存是不死的,你最终将会在某个时候耗尽所有的内存,因为所有分配过的内存都不会得到重用。因此应该在排查内存相关的错误的时候才开启zombie objects,其他时候应该关闭它。

在xcode4中,To edit environment variables, go to Menu Proct / Edit Scheme…, select the desired configuration (you probably want 'Run') from the left sidebar first and then click on the Arguments tab. Environment variables are configurable there.

6.运行一个IPhone程序时,弹出窗口说“程序运行失败,预置描述文件已过期” 。 解决办法是,在Xcode中, window-> Orgnazier -> 你的iphone ->删除带有红*的该程序之前的Profile 。 然后从Xcode运行该程序.

7.真机编译时报 Code Sign error: The identity doesn't match any valid certificate/private key pair in the default keychain

修改工程和Targets的get infouild 中的code signing identity为空

8.调试打印

CFShow(coreFoundationThingy) will print out a description of coreFoundationThingy to the console. Output looks something like: {value = w:1186.000000 h:687.000000 type = kAXValueCGSizeType}

If NSLog() is printing something out as an NSCFType, try CFShow().

9. 编译时报 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1,修改C/C++ Compiler Version为gcc4.2

10.this class is not key value coding-compliant for the key viewController

可能在创建了一个基于view的工程,而后把生成的viewcontroller删除了,但是在.xib中还有对它的引用,在IB中直接用delete键删除掉它就行了。

11.这台电脑上已经存在一个名为“embedded.mobileprovision”的预置文件,您是否要替换么?

http://blog.sina.com.cn/s/blog_6907b67f0100o2vw.html

12.真机调试时报failed to upload *.app

http://hi..com/%CB%E6%B7%E7_1989/blog/item/9649f49f805f05aec8eaf466.html

http://www.shouyanwang.org/thread-462-1-1.html

13.记的release时,先置delegate为nil。

一个节点不应该保留任何对不属于它的节点的引用。

14.模拟器

将xcode升级到4.3.1以后发现,ipad的模拟器,没有Home键了。Command+Shift+H就可以实现类似点击Home键的效果了。

J. 如何编译打包iOS系统

选择“Build Phases”选项卡点击红框标注的“+”按钮3在弹出的菜单中选择“New Run Script Phase…"4修改名称,单击红框标注的“Run Script",此处是为了增加编译号,所以名称我就改成了Build Number5在红框标注的输入框中输入:


赞 (0)