2

我正在尝试在我的项目中使用预构建的库...它的名称是 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)
4

1 回答 1

3

你需要使用

include ($BUILD_STATIC_LIBRARY)

代替

include ($BUILD_SHARED_LIBRARY)

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

于 2012-07-26T09:15:34.110 回答