How to use Android tesseract Android.mk files in my Android.mk?

我们两清 提交于 2019-12-11 21:30:44

问题


I was digging on using android tesseract api in my project.

https://github.com/rmtheis/tess-two

I copied com_googlecode_leptonica_android and com_googlecode_tesseract_android directory from tess-two to my project jni directory, my jni folder structure:

Android.mk
Application.mk
com_googlecode_leptonica_android
com_googlecode_tesseract_android
main_jni.cpp
...other h and cpp files...

I'm not sure how to include the Android.mk files in com_googlecode_leptonica_android and com_googlecode_tesseract_android inside my Android.mk file in jni directory.

LOCAL_PATH := $(call my-dir)
TESSERACT_PATH := $(LOCAL_PATH)/com_googlecode_tesseract_android/src
LEPTONICA_PATH := $(LOCAL_PATH)/com_googlecode_leptonica_android/src
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
$(info $(NDK_MODULE_PATH))
LOCAL_CFLAGS :=  -Wno-psabi
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
LOCAL_STATIC_LIBRARIES += android_native_app_glue
FILE_LIST_CPP := $(wildcard $(LOCAL_PATH)/*.cpp) # finds all cpp files
LOCAL_SRC_FILES := $(FILE_LIST_CPP:$(LOCAL_PATH)/%=%)
LOCAL_CFLAGS += \
    -DDEBUG \
    -DDEFAULT_DIR=\"/default\"
LOCAL_MODULE    := MyModule

include $(BUILD_SHARED_LIBRARY)

which does not work.

How to get this work?


回答1:


I couldn't compile Android.mk files in tess-two project, I just ended up with importing libtess.so and liblept.so files into my Android.mk as prebuilt library and I could use tesseract libraries in my jni file.



来源:https://stackoverflow.com/questions/23965907/how-to-use-android-tesseract-android-mk-files-in-my-android-mk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!