I found similar questions on SO but none of them were with the same workflow.
I have a .so library (libcurl) in my project. The project builds but I need to get a hold of curl.h in my c code inside JNI.
Here's my Android.mk file:
LOCAL_PATH:= $(call my-dir)
LIBS_PATH := libs/$(TARGET_ARCH_ABI)
include $(CLEAR_VARS)
LOCAL_MODULE := libcurl
LOCAL_SRC_FILES := $(LIBS_PATH)/libcurl.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := testLib
LOCAL_SRC_FILES := lib.c
LOCAL_SHARED_LIBRARIES += libcurl
include $(BUILD_SHARED_LIBRARY)
Here's my c class:
#include "curl/curl.h"
#include "lib.h"
JNIEXPORT jint JNICALL Java_com_example_test_1libcurlandroidlib_Lib_getTestNumber
(JNIEnv *env , jclass clazz)
{
return 99;
}
The issue is with the "curl/curl.h" include command. I have also tried as but it does not find it either:
jni/lib.c:2:23: fatal error: curl/curl.h: No such file or directory
#include "curl/curl.h"
I have my libcurl.so file inside a lib folder inside the JNI folder, which at build time generates the same (I think) file into the libs folder at the root of the app:
Does anyone have any idea why I am not able to get a referece to curl.h, or what I have to do to get a hold of this library?
Thank you!