Reputation: 37
I have these files in jni folder:
Android.mk
Application.mk
m_lanczos.c
m_lanczos.h
sresolution.cpp
and I just want to use my library in resolution.cpp like:
#include"m_lanczos.h"
What else do I have to add in Android.mk? Thank you!
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := super
LOCAL_SRC_FILES := sresolution.cpp
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
Upvotes: 2
Views: 2285
Reputation: 4165
There are two things that could be wrong:
You have forgot to compile m_lanczos.c:
Then your Android.mk should look like this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := super
LOCAL_SRC_FILES := sresolution.cpp m_lanczos.c
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
m_lanczos is a STATIC_LIBRARY:
Then you have to build it and include it:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := m_lanczos
LOCAL_SRC_FILES := m_lanczos.c
LOCAL_LDLIBS += #needed librarys for m_lanczos, probably nothing
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := super
LOCAL_SRC_FILES := sresolution.cpp
LOCAL_LDLIBS += -llog -ldl
LOCAL_STATIC_LIBRARIES := m_lanczos
include $(BUILD_SHARED_LIBRARY)
But i think it will be the first one, i hope that i helped :)
Upvotes: 1