shell脚本编译ffmpeg iOS静态库出错

错误一:xcrun -sdk iphoneos clang is unable to create an executable file.

C compiler test failed.

xcrun -sdk iphoneos clang is unable to create an executable file.
C compiler test failed.

解决方法:
我最近更新了 Xcode 10,所以直接第三步就可以了

第一步
1)检查你的 git 版本
2)确保你使用的是最新的 git 版本

第二步
1)在日志文件(ffmpeg-armv7/ffbuild/config.log)中使用关键字(xcrun: error)搜索错误详情
2)例如:你会发现 “xcrun: error: SDK "iphoneos” 不能被定位到

第三步
1)在终端输入 sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
2)输入 mac 登录密码
3)重试

转载自

来源:CSDN
原文:https://blog.csdn.net/qq910441958/article/details/82183840

错误二 :GNU assembler not found, install/update gas-preprocessor

GNU assembler not found, install/update gas-preprocessor

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

解决办法:(gas-preprocessor文件获取链接: https://pan.baidu.com/s/1KtyBxSt0uiz2md3NZKFGdw 提取码: p2hg)
1.根据提示将 git 升级至最新版本,重试(还是无效)
2.将 gas-preprocessor 文件添加至 /usr/local/bin/ 目录下,如果没有,请自行创建
3.将 gas-preprocessor 文件的权限修改为 可读可写可执行 777 或 可执行

chmod 777 /usr/local/bin/gas-preprocessor.pl

chmod +x /usr/local/bin/gas-preprocessor.pl

4.重试 OK

错误三: unknown directive .arch armv7-a

src/libavutil/arm/asm.S:50:9: error: unknown directive
        .arch armv7-a
        ^

解决方法:最新的 Xcode(Xcode 10) 已经减弱了对 32 位的支持, 解决方法:
你就不要编译 armv7 的版本喽,要不然使用老版本的Xcode进行编译

大千世界,求同存异;相遇是缘,相识是份,相知便是“猿粪”(缘分)
From MZou

你可能感兴趣的:(shell脚本编译ffmpeg iOS静态库出错)