title: What is the difference between gnustl_shared and gnustl_static in Android NDK library .a file?
body: <p>I want to create android library using c++ stl.</p>
  
  <p>my build tools are visual studio 2015, Visual GDB.</p>
  
  <p>source code is</p>
  
  <p>.cpp</p>
  
  <pre><code>#include &lt;jni.h&gt;
  #include "AndroidProject2.h"
  #include &lt;vector&gt;
  void foo() { std::vector&lt;int&gt; aaa; aaa.push_back(1); }
  </code></pre>
  
  <p>Android.mk</p>
  
  <pre><code># Generated by VisualGDB
  LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_MODULE    := AndroidProject2-shared
  LOCAL_SRC_FILES := AndroidProject2.cpp
  COMMON_SRC_FILES := $(LOCAL_SRC_FILES)
  include $(BUILD_SHARED_LIBRARY)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE    := AndroidProject2-static
  LOCAL_SRC_FILES :=  $(COMMON_SRC_FILES)
  include $(BUILD_STATIC_LIBRARY)
  </code></pre>
  
  <p>Application.mk</p>
  
  <pre><code>APP_MODULES := AndroidProject2-static AndroidProject2-shared
  APP_ABI := all
  APP_STL := gnustl_static
  NDK_TOOLCHAIN_VERSION :=4.9
  </code></pre>
  
  <p>I succeed build, so, created lib files libAndroidProject2-static.a, libAndroidProject2-static.so</p>
  
  <p>than, I try to change APP_STL option in Application.mk</p>
  
  <pre><code>APP_MODULES := AndroidProject2-static AndroidProject2-shared
  APP_ABI := all
  APP_STL := gnustl_shared
  NDK_TOOLCHAIN_VERSION :=4.9
  </code></pre>
  
  <p>surely, succeed build. so, created lib files libAndroidProject2-shared.a, libAndroidProject2-shared.so</p>
  
  <p>than, I Compare it and previous build outputs.</p>
  
  <p>I Found the difference about .so file. gnustl_static option's .so file is more bigger than gnustl_shared option's it.
  but .a is same.</p>
  
  <p>why?
  I used nm, readelf but can't find difference.
  what is diff???</p>