kewlbear / FFmpeg-iOS-build-script

Shell scripts to build FFmpeg for iOS and tvOS
3.03k stars 899 forks source link

C compiler test failed. #130

Closed qiweiqiang10 closed 6 years ago

qiweiqiang10 commented 6 years ago

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

kewlbear commented 6 years ago

Please find config.log and show me.

qiweiqiang10 commented 6 years ago

@kewlbear 问题已经解决了,看了看日志看到别人的回到解决了,答案给复制过来了

看下日志 ios/ffmpeg-armv7/config.log 中发现报错说 iphoneos 找不到 SDK "iphoneos" cannot be located

这句报错 是根源 在执行编译脚本中,遇到一句xcrun --sdk iphoneos --show-sdk-path报错

mac$ xcrun --sdk iphoneos --show-sdk-path xcrun: error: SDK "iphoneos" cannot be located 查找原因:

mac$ xcode-select --print-path /Library/Developer/CommandLineTools 发现是这个Xcode路径判断错误。

mac$ xcodebuild -showsdks xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance 回想起最近安装了另外两个版本的Xcode,应该是这样导致了路径错误。

mac$ ls /Applications/Xcode Xcode.app/ Xcode2.app/ Xcode3.app/ 解决方法:给Xcode命令行工具指定路径

mac$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/ 再回头查看

复制代码 mac$ xcrun --sdk iphoneos --show-sdk-path

接着编译即可解决问题 这种因为Xcode 不同版本前后的位置变化 导致,编译的脚本未做更新 开源软件 哎 疼点就是 问的问题没人理睬 希望上面的对其他有帮助

Leppard commented 6 years ago

Exactly same error as above, in config.log the message said: SDK "iphoneos" cannot be located.

The problem solved by sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

Thanks for @qiweiqiang10's solution.