title: a problem about Adroid.mk
body: <p>I'm a newer to Android NDK. </p>
  
  <p>There are 3 files, "first.c, first.h, second.c"
  I want to compile to 2 shared libraries (libfirst.so, libsecond.so, the second one using the first one)</p>
  
  <p>bellow is the <strong>Android.mk</strong></p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  
  
  # first lib
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := libtwolib-first
  LOCAL_SRC_FILES := first.c
  
  include $(BUILD_SHARED_LIBRARY)
  
  # second lib
  #
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := libtwolib-second
  LOCAL_SRC_FILES := second.c
  
  LOCAL_SHARED_LIBRARIES := libtwolib-first
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p><strong>first.h</strong></p>
  
  <pre><code>extern int first(int  x, int  y);
  </code></pre>
  
  <p><strong>second.c</strong></p>
  
  <pre><code>jint
  Java_com_example_twolibs_TwoLibs_add( JNIEnv*  env,
                                        jobject  this,
                                        jint     x,
                                        jint     y )
  {
      return first(x, y);
  }
  </code></pre>
  
  <p>But when to run this program, the application is forced to shut down.
  if first is compiled to static library. then it's OK. Like the related Android.mk bellow:</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  
  # first lib, which will be built statically
  #
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := libtwolib-first
  LOCAL_SRC_FILES := first.c
  
  include $(BUILD_STATIC_LIBRARY)
  
  # second lib, which will depend on and include the first one
  #
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := libtwolib-second
  LOCAL_SRC_FILES := second.c
  
  LOCAL_STATIC_LIBRARIES := libtwolib-first
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Can anyone help me? 
  Thanks a lot...</p>