2

I am trying to use a pre built library within my project...its name is libfreeimage.so... I am not able to build it properly using the NDK-build.... The error log has been pasted here... please help me in this regard...

flock@QS57:~/Desktop/android-imagefilter-ndk$ /home/flock/ANDROID/android-ndk-r8/ndk-build
Prebuilt       : libfreeimage.so <= jni/
Install        : libfreeimage.so => libs/armeabi/libfreeimage.so
/home/flock/ANDROID/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-strip: Unable to recognise the format of the input file `./libs/armeabi/libfreeimage.so'
make: *** [libs/armeabi/libfreeimage.so] Error 1
make: *** Deleting file libs/armeabi/libfreeimage.so
flock@QS57:~/Desktop/android-imagefilter-ndk$ 

My android.mk file-

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libfreeimage
LOCAL_SRC_FILES := libfreeimage.a
include $(PREBUILT_SHARED_LIBRARY)

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE    := imageprocessing
LOCAL_SRC_FILES := imageprocessing.c
LOCAL_SHARED_LIBRARIES := libfreeimage
LOCAL_LDLIBS    := -lm -llog -ljnigraphics

include $(BUILD_SHARED_LIBRARY)
Sreekanth Karumanaghat
  • 3,383
  • 6
  • 44
  • 72
  • 1
    possible duplicate of [including a prebuilt shared object file in an NDK project](http://stackoverflow.com/questions/9205245/including-a-prebuilt-shared-object-file-in-an-ndk-project) – Graham Borland Jul 23 '12 at 10:31
  • post you Android.mk file – Nermeen Jul 23 '12 at 10:32
  • 1
    Possible Duplicate of: http://stackoverflow.com/questions/10593987/android-ndk-linking – codetiger Jul 24 '12 at 06:04
  • @codetiger...I am just using a prebuilt library freeimage.so and using it in the C code can you please help me how to modify the code and where to put this library so that I can make my project to work??Any help in this regard will be highly appreciated...thank you – Sreekanth Karumanaghat Jul 24 '12 at 07:30

1 Answers1

3

You need to use

include ($BUILD_STATIC_LIBRARY)

instead of

include ($BUILD_SHARED_LIBRARY)

This will give you the desired .a file, not the .so.

Viktor Latypov
  • 14,289
  • 3
  • 40
  • 55