Chilkat C/C++ Libraries for Android

* Includes static libs for arm64-v8a, armeabi-v7a, x86, and x86_64.

Download

v9.5.0.98 29-Mar-2024sha256: ad5b20358fdc3cca849850962ccb37ce4f778773caef228895f1b7428b4437ae
Chilkat C/C++ Libs for Android

Chilkat Reference Documentation

Chilkat Sample Code

Chilkat Blog

Chilkat Release Notes

Install the binary distribution by extracting the files from the compressed archive. For example:

gzip -d chilkat-9.5.0-android-cpp.tar.gz
tar -xf chilkat-9.5.0-android-cpp.tar

This will create a 'chilkat-9.5.0-android-cpp' sub-directory containing the Chilkat C++ binary distribution.

C / C++ Headers

The C and C++ header files (.h) are located in the "include" subdirectory.

Static Libraries

The static libraries (each named libchilkat-9.5.0.a) are located in the "lib/arm64-v8a", "lib/armeabi-v7a", "lib/x86", and "lib/x86_64" subdirectories.

The -L compiler option may be used to add an additional directory to the library search path

Linker Options to Reduce EXE Size

Use the following linker options to minimize the size of your application's EXE.

-Wl,--gc-sections,--icf=safe

(For the arm64 architecture, omit the ",--icf=safe")

Android.mk for Building a "C" Application

Here is a sample Android.mk for building a "C" application. Even though your application may be purely "C" code, Chilkat requires the C++ runtime libs to be linked. This Android.mk shows how to do it. (Thank you Øyvind for this sample!)

LOCAL_PATH:= $(call my-dir)

# Chilkat lib
include $(CLEAR_VARS)
LOCAL_MODULE := ChilkatAndroid
LOCAL_SRC_FILES := /home/ubuntu/chilkat-9.5.0-android-cpp/libs/arm64-v8a/libchilkatAndroid.a
include $(PREBUILT_STATIC_LIBRARY)

# libc++static runtime
include $(CLEAR_VARS)
LOCAL_MODULE := libc++static
LOCAL_SRC_FILES := /opt/android-ndk-r17c/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_static.a
include $(PREBUILT_STATIC_LIBRARY)

# libc++abi_static runtime
include $(CLEAR_VARS)
LOCAL_MODULE := libc++abi_static
LOCAL_SRC_FILES := /opt/android-ndk-r17c/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_STATIC_LIBRARIES +=    ChilkatAndroid \
	                            libc++static \
	                            libc++abi_static

LOCAL_C_INCLUDES += /home/ubuntu/chilkat-9.5.0-android-cpp/include
LOCAL_SRC_FILES := main.c 
LOCAL_MODULE := chilkattest_with_ndk_c
include $(BUILD_EXECUTABLE)