title: android build static lib
body: <p>I am planning to user static Linux .a library into android.
  I have created static .a file using following link <a href="http://codingfreak.blogspot.in/2010/01/creating-and-using-static-libraries-in.html" rel="nofollow">http://codingfreak.blogspot.in/2010/01/creating-and-using-static-libraries-in.html</a></p>
  
  <p>i have following Android.mk file in my Android application.</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE:= first-prebuilt
  LOCAL_SRC_FILES:= libarith.a
  LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
  include $(PREBUILT_STATIC_LIBRARY)
  
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := test-main
  LOCAL_STATIC_LIBRARIES := first-prebuilt
  LOCAL_SRC_FILES := native.cpp
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>When I build application using ndk-build r7b, it gives following error.</p>
  
  <pre><code>Сompile++ thumb  : test-main &lt;= native.cpp
  SharedLibrary  : libtest-main.so
  /home/hiren/NDK-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: /home/hiren/workspace/VideoTEST/obj/local/armeabi/libarith.a(addition.o): Relocations in generic ELF (EM: 3)
  /home/hiren/workspace/VideoTEST/obj/local/armeabi/libarith.a: could not read symbols: File in wrong format
  collect2: ld returned 1 exit status
  make: *** [/home/hiren/workspace/VideoTEST/obj/local/armeabi/libtest-main.so] Error 1
  </code></pre>
  
  <p>Can anyone help, I am stuck for a long time, here...
  Thanks in advance.</p>