I need to integrate the curl library into an android project in order to send requests from under C ++
The whole problem is the integration of this library using android.mk
What I just did not try (spent more than 9 hours) and failed to integrate curl using android.mk
Important! cMake doesn't interest me. We need the implementation on android.mk
What I have: compiled curl libraries for different ABIs (libcurl.a), include folder (.h files)
There are not many tutorials on google for integrating curl into an android project
How I did (android.mk):
then flags, declaration LOCAL_MODULE (for SHARED_LIBRARY), SRC_FILES (only for LOCAL_MODULE), LOCAL_LDLIBS and at the end include $(BUILD_SHARED_LIBRARY)
But this was not successful. The build is going well. But if I add the
to the main native-lib.cpp file, then the project does not see this file. But if I specify the full path #include "../.../....." then the file is integrated
But the trouble is that .h files inside curl cannot include themselves. Solution: I need to make a relative path in each file, not an absolute one, and this is not productive at all
The whole problem boils down to the fact that it is not possible to take out .h files so that they can be accessed through <curl/curl.h>, and not by "absolute path"
If anyone has an example of curl integration based on android.mk, please share your android.mk file setup or tell me what I'm doing wrong
The whole problem is the integration of this library using android.mk
What I just did not try (spent more than 9 hours) and failed to integrate curl using android.mk
Important! cMake doesn't interest me. We need the implementation on android.mk
What I have: compiled curl libraries for different ABIs (libcurl.a), include folder (.h files)
There are not many tutorials on google for integrating curl into an android project
How I did (android.mk):
C++:
include $(CLEAR_VARS)
LOCAL_MODULE := ssl
LOCAL_SRC_FILES := build/openssl/$(TARGET_ARCH_ABI)/lib/libssl.a
LOCAL_EXPORT_CFLAGS := build/openssl/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := build/openssl/$(TARGET_ARCH_ABI)/lib/libcrypto.a
LOCAL_EXPORT_CFLAGS := build/openssl/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := build/curl/$(TARGET_ARCH_ABI)/lib/libcurl.a
LOCAL_EXPORT_CFLAGS := $(LOCAL_PATH)build/curl/$(TARGET_ARCH_ABI)/include/curl/
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := build/openssl/$(TARGET_ARCH_ABI)/include \
$(LOCAL_PATH)build/curl/$(TARGET_ARCH_ABI)/include
LOCAL_STATIC_LIBRARIES := libcurl libssl libcrypto
then flags, declaration LOCAL_MODULE (for SHARED_LIBRARY), SRC_FILES (only for LOCAL_MODULE), LOCAL_LDLIBS and at the end include $(BUILD_SHARED_LIBRARY)
But this was not successful. The build is going well. But if I add the
C++:
#include <curl/curl.h>
But the trouble is that .h files inside curl cannot include themselves. Solution: I need to make a relative path in each file, not an absolute one, and this is not productive at all
The whole problem boils down to the fact that it is not possible to take out .h files so that they can be accessed through <curl/curl.h>, and not by "absolute path"
If anyone has an example of curl integration based on android.mk, please share your android.mk file setup or tell me what I'm doing wrong