Eclipse NDK, NativeActivity project. I ma trying to add a liquidfun(Box2D) library to my existing project. Unfortunately, no one in internet explain how to precisely do. I'am stuck after building library using ndk (following this https://google.github.io/liquidfun/Building/html/md__building_android.html), and run sample project. I have totally no idea how to use it in my own project. My Android.mk, i already using sfml.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := sfml-example
PROJECT_FILES := $(wildcard $(LOCAL_PATH)/CPP/*.cpp)
PROJECT_FILES := $(PROJECT_FILES:$(LOCAL_PATH)/%=%)
LOCAL_SRC_FILES := main.cpp
LOCAL_SRC_FILES += $(PROJECT_FILES)
FILE_LIST := $(wildcard $(LOCAL_PATH)*.cpp)
LOCAL_SHARED_LIBRARIES := sfml-system
LOCAL_SHARED_LIBRARIES += sfml-window
LOCAL_SHARED_LIBRARIES += sfml-graphics
LOCAL_SHARED_LIBRARIES += sfml-audio
LOCAL_SHARED_LIBRARIES += sfml-network
LOCAL_WHOLE_STATIC_LIBRARIES := sfml-main
include $(BUILD_SHARED_LIBRARY)
$(call import-module,sfml)
Thanks in advance.
I have some prebuild libraries in my own project, and i include them like:
this is for prebuilt static library (with .a extension). If you would like to include shared, just change it to
BUILD_SHARED_LIBRARY
. This file to include is insideMyProject/jni/lib/{arch}
folder (with other libraries) and header files of library are put insideMyProject/jni/curl/include
(just like it is visible inLOCAL_EXPORT_C_INCLUDES
variable)the names you pass to
LOCAL_STATIC_LIBRARIES
must be same as one that are declared inLOCAL_MODULE
of other libraries/modules.also everything you will probably need you can find in NDK docs that are in NDK folder. For prebuilt libraries there is separate section.