In the previous post, I showed how you can compile FreeImage for Android. In this post, I'll demonstrate how you can include the resulting FreeImage library in your project.
Add the following to your Android.mk file:
include $(CLEAR_VARS)
LOCAL_MODULE := FreeImage
LOCAL_SRC_FILES := ./external/freeimage/lib/$(TARGET_ARCH_ABI)/libFreeImage.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/external/freeimage/include
include $(PREBUILT_STATIC_LIBRARY)
$(TARGET_ARCH_ABI)
will resolve to the target ABI (e.g. armeabi-v7a). The static library should be placed in the first path above, and the FreeImage.h header in the second.
Then, add
LOCAL_STATIC_LIBRARIES := FreeImage
Be aware that if your main module is composed of only C code, you'll have to include an empty C++ file, otherwise the STL won't be linked in to your build.
include $(CLEAR_VARS)
LOCAL_MODULE := Empty
LOCAL_SRC_FILES := Empty.cpp
include $(BUILD_STATIC_LIBRARY)
LOCAL_STATIC_LIBRARIES := FreeImage Empty