NDK构建错误

时间:2012-07-23 10:20:50

标签: android android-ndk

我正在尝试在我的项目中使用预先构建的库...它的名字是libfreeimage.so ... 我无法使用NDK-build正确构建它.... 错误日志已粘贴在此处... 请帮助我这方面......

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$ 

我的android.mk文件 -

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)

1 个答案:

答案 0 :(得分:2)

您需要使用

include ($BUILD_STATIC_LIBRARY)

而不是

include ($BUILD_SHARED_LIBRARY)

这将为您提供所需的.a文件,而不是.so。