我正在尝试在tutorial here之后为iOS编译FFmpeg(对于iPhone5,为了做一些RSTP流媒体的东西),但我遇到了这个错误:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
在我的config.log文件中,我有这个:
BEGIN /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
1 int main(void){ return 0; }
END /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -arch armv7 -mfpu=neon -miphoneos-version-min=6.0 -mcpu=cortex-a9 -c -o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.Wv4eZtHX.o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.y84bbrJt /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.Wv4eZtHX.o
ld: library not found for -lcrt1.3.1.o
collect2: ld returned 1 exit status
C compiler test failed.
我在stackoverflow或google
上找到的其他脚本有其他错误有什么想法吗?
好的(我是mac环境上的新手),我设法通过将sdk目标修复到我拥有的最后一个sdk(6.1),删除其他链接器标志然后“make”命令已满而通过配置步骤错误(使用gcc或arm-apple-darwin10-gcc-4.2):
In file included from ./libavutil/internal.h:113,
from ./libavutil/common.h:385,
from ./libavutil/avutil.h:238,
from libavdevice/version.h:28,
from libavdevice/avdevice.h:22,
from libavdevice/alldevices.c:22:
./libavutil/libm.h:53: error: static declaration of ‘cbrt’ follows non-static declaration
./libavutil/libm.h:60: error: static declaration of ‘cbrtf’ follows non-static declaration
./libavutil/libm.h:86: error: expected identifier or ‘(’ before ‘sizeof’
./libavutil/libm.h:96: error: expected identifier or ‘(’ before ‘sizeof’
./libavutil/libm.h:142: error: static declaration of ‘rint’ follows non-static declaration
./libavutil/libm.h:149: error: static declaration of ‘lrint’ follows non-static declaration
./libavutil/libm.h:156: error: static declaration of ‘lrintf’ follows non-static declaration
./libavutil/libm.h:163: error: static declaration of ‘round’ follows non-static declaration
./libavutil/libm.h:170: error: static declaration of ‘roundf’ follows non-static declaration
./libavutil/libm.h:177: error: static declaration of ‘trunc’ follows non-static declaration
./libavutil/libm.h:184: error: static declaration of ‘truncf’ follows non-static declaration
make: *** [libavdevice/alldevices.o] Error 1
答案 0 :(得分:1)
./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='/usr/local/bin/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/iPhoneOS6.1.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm
您还必须关注“--as = / usr / local / bin / gas-preprocessor.pl”或“... / SDKs / iPhoneOS6.1.sdk”之类的路径,并根据自己的路径进行调整/ SDK