I have seen multiple other similar question on SO about 'linking' problems with android.mk but none of them are close to my problem.
I have an Android project that creates a base shared C++ library from source code and should link to another shared library.
I have followed the instructions that are pretty clear and basic.
The base shared library compiles fine, but at link time, it tells me that the the referenced shared library is nowhere to be found.
Here is the source code of the Android.mk file:
# ./android/app/src/main/jni/Android.mk
# Set up paths
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# specify libcardios prebuilt shared library
LOCAL_MODULE := libcardios
LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../third_party_src/cpp/libcardios/$(TARGET_ARCH_ABI)/libcardios_$(TARGET_ARCH_ABI).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../third_party_src/cpp/libcardios/includes
include $(PREBUILT_SHARED_LIBRARY)
# main shared library
# Debug mode
NDK_DEBUG=1
# Specify C++ flags
LOCAL_CPPFLAGS := -std=c++11
LOCAL_CPPFLAGS += -fexceptions
LOCAL_CPPFLAGS += -frtti
LOCAL_CPPFLAGS += -Wall
LOCAL_CPPFLAGS += -Wextra
# Header search paths
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../generated_src/djinni_bridge/jni
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../generated_src/djinni_bridge/cpp
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../generated_src/support-lib/jni
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../generated_src/support-lib
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../src/cpp
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../generated_src/support-lib/cpp
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../third_party_src/cpp
LOCAL_CPPFLAGS += -I$(LOCAL_PATH)/../../../../../third_party_src/cpp/data
# Specify source files
LOCAL_SRC_FILES += $(LOCAL_PATH)/../../../../../generated_src/djinni_bridge/jni/NativeDataBridge.cpp
LOCAL_SRC_FILES += $(LOCAL_PATH)/../../../../../ios/data_bridge_impl.cpp
LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/../../../../../generated_src/support-lib/jni/*.cpp)
LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/../../../../../generated_src/support-lib/cpp/*.cpp)
LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/../../../../../generated_src/djinni_bridge/cpp/*.cpp)
LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/../../../../../third_party_src/cpp/data/*.cpp)
LOCAL_SHARED_LIBRARIES := libcardios
# Specify module name for System.loadLibrary() call
LOCAL_MODULE := databridge
# include additional libraries
LOCAL_LDLIBS += -llog
# Telling make to build the library
include $(BUILD_SHARED_LIBRARY)
Now here is thee error message I've got:
clang++: error: no such file or directory: '/Users/omatrot/Documents/sensoria_analyics/application/android/app/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libcardios_arm64-v8a.so'
I' under the impression that the prebuilt shared library is not found and thus not copied in the intermediate folder.
What is going wrong here?
from android.mk: prebuilt shared library not found
No comments:
Post a Comment