由于不再有,说明已更改gcc
在 xcode SDK 中。
您需要做的是使用 xcrun 指定 cc 是 iphoneos 编译器,因此我们之前只是将路径放入gcc
,我们现在要引用xcrun
for clang
.
我从git下载了最新的ffmpeg,确保我在路径上有一份gas-preprocess.pl的副本,然后更改了--cc=
行读取:
--cc='xcrun -sdk iphoneos clang -mios-version-min=5.1'
(这假设您正在构建并仍然以 ios 5.1 为目标 - 如果您以较新版本为目标,则将值更改为较新版本。我为我指定了 7.0,但我也使用 iOS 8.4 SDK,因此配置线路看起来像:
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver \
--enable-cross-compile --arch=arm --target-os=darwin \
--cc='xcrun -sdk iphoneos clang -mios-version-min=7.0' \
--sysroot=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk \
--cpu=cortex-a8 --extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk' \
--enable-pic
它从 ios8.4 SDK 构建 ffmpeg。这些说明应该继续有效;你只需要更换合适的7.0
/8.4
较新 SDK 的值。
旧答案
当您尝试使用 MacOS 版本的编译器编译 iOS 代码时,就会发生这种情况。
您需要使用以下命令指定 gcc 的 iPhoneOS 版本:
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver
--enable-cross-compile --arch=arm --target-os=darwin
--cc=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
--as='gas-preprocessor/gas-preprocessor.pl /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc'
--sysroot=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
--cpu=cortex-a8 --extra-cflags='-arch armv7'
--extra-ldflags='-arch armv7
-isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk'
--enable-pic
尝试调试问题时的第一步configure
是看config.log
作为运行的一部分生成的文件。