title: Android std and stl support
body: <p>I am playing with android ndk. I am using Window Vista with cygwin (latest version). I compiled and launched the hello world jni sample on my phone. It is working. The code is (is a .cpp file):</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;jni.h&gt;
  
  extern "C" {
  JNIEXPORT jstring JNICALL     Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv* env, jobject     javaThis);
  };
  
  
  jstring Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv*     env, jobject javaThis)
  {
      return  env-&gt;NewStringUTF("Hello from native code!");
  } 
  </code></pre>
  
  <p>I wanted to add some modifications, just to play with it a bit:</p>
  
  <pre><code>#include &lt;algorithm&gt;
  </code></pre>
  
  <p>and then, in the function above, i added:</p>
  
  <pre><code>int a;
  a=std::min&lt;int&gt;(10, 5);
  </code></pre>
  
  <p>but the compiler says that it cannot find the file 'algorithm'  and that min() is not part of std.</p>
  
  <p>After a bit of searching, i have found that the android ndk has a gnu-libstdc++ directory with all the std files needed. Reading the NDK docs, i have learned that usint std::*  should work without any modification to the code (if one include the proper header files). But it seems that gcc on cygwin is not able to find the needed files.</p>
  
  <p>What are the steps to do in order to be able to use std and stl within a .cpp file in an android ndk app?</p>