title: Compiling FFmpeg : libx264 not found
body: <p>I hope some one helps me the solve this problems. I was trying to compile FFmpeg 2.2.3 library under ubuntu 12.04LTS for android using android ndk r10e by following this tutorials: </p>
  
  <p><a href="http://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/" rel="nofollow" title="Tutorial1">Tutorial1</a></p>
  
  <p><a href="http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/" rel="nofollow" title="Roman10">Tutorial2</a></p>
  
  <p>here is my build_android.sh file:</p>
  
  <pre><code>#!/bin/bash
  NDK=/home/rango/Desktop/android-ndk-r10e
  SYSROOT=$NDK/platforms/android-19/arch-arm/
  TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
  
  #ADDI_LDFLAGS="-L /usr/local/lib"
  #ADDI_CFLAGS="-I /usr/include"
  
  function build_one
  {
  ./configure \
  --prefix=$PREFIX \
  --enable-shared \
  --enable-static \
  --disable-doc \
  --disable-ffmpeg \
  --disable-ffplay \
  --disable-ffprobe \
  --disable-ffserver \
  --disable-doc \
  --disable-symver \
  --enable-protocol=concat \
  --enable-protocol=file \
  --enable-muxer=mp4 \
  --enable-demuxer=mpegts \
  --enable-memalign-hack \
  --enable-gpl \
  --enable-libx264 \
  --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
  --target-os=linux \
  --arch=arm \
  --enable-cross-compile \
  --sysroot=$SYSROOT \
  --extra-cflags="-Os -fpic -marm $ADDI_CFLAGS" \
  --extra-ldflags="$ADDI_LDFLAGS" \
  
  make clean
  make -j4
  make install
  }
  
  CPU=arm
  PREFIX=$(pwd)/android/$CPU
  
  build_one
  </code></pre>
  
  <p>when i execute buid_android.sh script without --enable-libx264 \ line everything is going well and i can get .a files on android/arm/ folder. but with this line it fails and show the following error in the console:</p>
  
  <blockquote>
    <p>ERROR: libx264 not found</p>
    
    <p>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 ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on
    irc.freenode.net. Include the log file "config.log" produced by
    configure as this will help</p>
  </blockquote>
  
  <p>it seems like it can't find where the libraries are, as i get a lot of the following errors in config.log file:</p>
  
  <blockquote>
    <p>"LIBNAME".h: No such file or directory
    newlib.h: No such file or
    directory mingw.h: No such file or directory
    x264.h: No such file or
    directory</p>
  </blockquote>
  
  <p>Here is the tail of config.log file:</p>
  
  <pre><code>check_mathfunc truncf 1
  check_ld cc
  check_cc
  BEGIN /tmp/ffconf.zGKqGin6.c
      1   #include &lt;math.h&gt;
      2   float foo(float f, float g) { return truncf(f); }
      3   int main(void){ return (int) foo; }
  END /tmp/ffconf.zGKqGin6.c
  /home/rango/Desktop/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -isysroot /home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -Os -fpic -marm -march=armv5te -std=c99 -fomit-frame-pointer -fPIC -marm -pthread -c -o /tmp/ffconf.8Q9ke3aO.o /tmp/ffconf.zGKqGin6.c
  /home/rango/Desktop/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -isysroot /home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -Wl,--as-needed -o /tmp/ffconf.3sjTkc5z /tmp/ffconf.8Q9ke3aO.o -lm -lz -pthread
  check_lib x264.h x264_encoder_encode -lx264
  check_header x264.h
  check_cpp
  BEGIN /tmp/ffconf.zGKqGin6.c
      1   #include &lt;x264.h&gt;
      2   int x;
  END /tmp/ffconf.zGKqGin6.c
  /home/rango/Desktop/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -isysroot /home/rango/Desktop/android-ndk-r10e/platforms/android-19/arch-arm/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -Os -fpic -marm -march=armv5te -std=c99 -fomit-frame-pointer -fPIC -marm -pthread -E -o /tmp/ffconf.8Q9ke3aO.o /tmp/ffconf.zGKqGin6.c
  /tmp/ffconf.zGKqGin6.c:1:18: fatal error: x264.h: No such file or directory
   #include &lt;x264.h&gt;
                    ^
  compilation terminated.
  ERROR: libx264 not found
  </code></pre>