title: Compiling for android from linux with g++
body: <p>I'm trying to compile .cc files for android from linux with arm-linux-androideabi-g++ tool. It includes <code>#include&lt;algorithm&gt;</code>.<br>
  When I try to compile it I get this error:<br>
  <code>fatal error: algorithm: No such file or directory</code>
  I think that I should point library headers to the compiler with -I flag, but I'm not sure what directory it should be.<br>
  Does anyone has any idea how to compile it?<br>
  I tried looking in ndk package for the header file:</p>
  
  <pre><code>./toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/5.0.300080/include/cuda_wrappers/algorithm
  ./toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/5.0/include/cuda_wrappers/algorithm
  ./sources/cxx-stl/llvm-libc++/include/algorithm
  ./sources/cxx-stl/llvm-libc++/include/experimental/algorithm
  ./sources/cxx-stl/stlport/stlport/algorithm
  ./sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm
  ./sources/cxx-stl/gnu-libstdc++/4.9/include/ext/algorithm
  ./sources/cxx-stl/gnu-libstdc++/4.9/include/parallel/algorithm
  </code></pre>
  
  <p>I tried with these two directories:  </p>
  
  <pre><code>arm-linux-androideabi-g++ hello.cc -I/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include
  In file included from /ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm:60:0,
       from hello.cc:1:
       /ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/utility:68:28:  
       fatal error: bits/c++config.h: No such file or directory
  compilation terminated.
  
  arm-linux-androideabi-g++ hello.cc -I/ndk/sources/cxx-stl/llvm-libc++/include/
  In file included from /ndk/sources/cxx-stl/llvm-libc++/include/exception:82:0,
                   from /ndk/sources/cxx-stl/llvm-libc++/include/typeinfo:61,
                   from /ndk/sources/cxx-stl/llvm-libc++/include/memory:644,
                   from /ndk/sources/cxx-stl/llvm-libc++/include/algorithm:643,
                   from hello.cc:1:
  /ndk/sources/cxx-stl/llvm-libc++/include/cstdlib:114:9: error: '::strtold' has not been declared
  /ndk/sources/cxx-stl/llvm-libc++/include/cstdlib:132:9: error: '::_Exit' has not been declared
  </code></pre>
  
  <p>What I try to do is build protobuf library for android. The build fails with missing algorithm file. This is my attempt to break it down.</p>