Below is the content of jni/Application.mk
APP_MODULES := liblept
APP_ABI := ALL
APP_OPTIM := release
APP_PLATFORM = android-8
APP_STL := gnustl_static
APP_CPPFLAGS += -fexceptions -frtti -ffat-lto-objects
NDK_TOOLCHAIN_VERSION := 4.9
Below is the content of jni/Android.mk
REAL_LOCAL_PATH := /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android
LOCAL_PATH :=
Below is the content of jni/Application.mk APP_MODULES := liblept APP_ABI := ALL APP_OPTIM := release APP_PLATFORM = android-8 APP_STL := gnustl_static APP_CPPFLAGS += -fexceptions -frtti -ffat-lto-objects NDK_TOOLCHAIN_VERSION := 4.9
Below is the content of jni/Android.mk REAL_LOCAL_PATH := /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android LOCAL_PATH :=
include $(CLEAR_VARS)
LOCAL_MODULE := liblept
BLACKLIST_SRC_FILES := \ %endiantest.c \ %freetype.c \ %xtractprotos.c
LOCAL_SRC_FILES := \ $(filter-out $(BLACKLIST_SRC_FILES),$(wildcard $(LEPTONICA_PATH)/src/*.c))
LOCAL_CFLAGS := \ -DHAVE_CONFIG_H
LOCAL_C_INCLUDES := \ $(LIBJPEG_PATH)
LOCAL_LDLIBS := \ -lz
ifneq ($(TARGET_SIMULATOR),true) LOCAL_SRC_FILES += \ $(REAL_LOCAL_PATH)/stdio/open_memstream.c \ $(REAL_LOCAL_PATH)/stdio/fopencookie.c \ $(REAL_LOCAL_PATH)/stdio/fmemopen.c
LOCAL_C_INCLUDES += \ $(REAL_LOCAL_PATH)/stdio endif
LOCAL_SRC_FILES += \ $(REAL_LOCAL_PATH)/box.cpp \ $(REAL_LOCAL_PATH)/pix.cpp \ $(REAL_LOCAL_PATH)/pixa.cpp \ $(REAL_LOCAL_PATH)/utilities.cpp \ $(REAL_LOCAL_PATH)/readfile.cpp \ $(REAL_LOCAL_PATH)/writefile.cpp \ $(REAL_LOCAL_PATH)/jni.cpp
LOCAL_C_INCLUDES += \ $(REAL_LOCAL_PATH) \ $(LEPTONICA_PATH)/src
LOCAL_LDLIBS += \ -ljnigraphics \ -llog \ -ldl
LOCAL_SHARED_LIBRARIES:= libjpeg LOCAL_PRELINK_MODULE:= false
include $(BUILD_SHARED_LIBRARY)
Build Errors : ./obj/local/arm64-v8a/objs/lept//home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/open_memstream.o: In function
open_memstream': /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/**open_memstream.c:188: undefined reference to
sfp' ./obj/local/arm64-v8a/objs/lept//home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fopencookie.o: In function `fopencookie': /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fopencookie.c:154: undefined reference to`sflags' /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fopencookie.c:161: undefined reference to__sfp' ./obj/local/arm64-v8a/objs/lept//home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fmemopen.o: In function
fmemopen': /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fmemopen.c:209: undefined reference to__sflags' /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fmemopen.c:215: undefined reference to
__sfp' /home/adarsh/Downloads/Leptonica-full-build/app/src/main/jni/com_googlecode_leptonica_android/stdio/fmemopen.c:215: undefined reference to `__sfp' collect2: error: ld returned 1 exit status make: * [obj/local/arm64-v8a/liblept.so] Error 1