objective-cxcodeffmpegios5.1

Big problems while compiling FFMPEG for iOS5


I'm trying to compile the ffmpeg library for iOS5. I tried different options but none works.

I downloaded this: https://github.com/ciphor/ffmpeg4ios .

I tried the original build_armv7 but it didn't work. I edited the build_arm7 file and now it looks like this:

#!/bin/tcsh -f

if (! -d armv7) mkdir armv7
if (! -d lib) mkdir lib

rm armv7/*.a

make clean

./configure --disable-network --disable-mpegaudio-hp --disable-lpc --disable-vaapi 
--disable-vdpau --disable-hwaccels --disable-mmx --disable-mmx2 --disable-sse 
--disable-ssse3 --disable-avx --disable-amd3dnow --disable-amd3dnowext --disable-vis 
--disable-mmi --disable-doc --disable-yasm --disable-ffmpeg --disable-ffplay 
--disable-ffprobe --disable-ffserver --disable-rdft --disable-dxva2 --disable-encoders 
--disable-decoders --enable-decoder=h264 --disable-bsfs --disable-protocols 
--disable-indevs --disable-outdevs --disable-devices --disable-filters --disable-demuxers --enable-demuxer=h264 
--disable-muxers --disable-parsers --enable-parser=h264 --enable-cross-compile --arch=arm 
--target-os=darwin 
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 --as='gas-preprocessor/gas-preprocessor.pl /Aplications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2' 
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=cortex-a8 
--extra-cflags='-pipe -Os -gdwarf-2 -issysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m${thumb_opt:-no-thumb} 
-mthumb-interwork' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' --enable-pic


make

mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/

rm lib/*.a

cp armv7/*.a lib/

But i get this error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 is unable to create an executable file. C compiler test failed.

I looked all over the Internet. I have read all the posts on stackoverflow about this but none helped me. Please tell me what i'm doing wrong and please don't post me links: trust me, i saw them all!


Solution

  • Inspect config.log file in your root compilation directory and search for "C compiler test failed.`' You will find right there the command that was tried and the exact reason why it failed (i.e., the compiler output).

    It could be that the compiler installation directory is not /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/, or that some library cannot be found, etc...

    Actually, what I see is that you are specifying on the configure command line a few paths. Have you checked that they are correct for your Xcode version?