diff -ruN tesseract-4.1.1/src/api/baseapi.cpp tesseract-4.1.1-android/src/api/baseapi.cpp --- tesseract-4.1.1/src/api/baseapi.cpp 2019-12-26 23:21:51.000000000 +0900 +++ tesseract-4.1.1-android/src/api/baseapi.cpp 2019-12-29 07:09:51.811379194 +0900 @@ -39,6 +39,10 @@ #include #endif // _WIN32 +#include +int fgetpos(FILE* __fp, fpos_t* __pos); +int fsetpos(FILE* __fp, const fpos_t* __pos); + #include // for round, M_PI #include // for int32_t #include // for strcmp, strcpy diff -ruN tesseract-4.1.1/src/api/Makefile.am tesseract-4.1.1-android/src/api/Makefile.am --- tesseract-4.1.1/src/api/Makefile.am 2019-12-29 07:09:40.275394645 +0900 +++ tesseract-4.1.1-android/src/api/Makefile.am 2019-12-29 07:09:51.811379194 +0900 @@ -80,7 +80,7 @@ libtesseract_la_LIBADD += ../arch/libtesseract_sse.la endif -libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION) $(NOUNDEFINED) +libtesseract_la_LDFLAGS += -avoid-version $(NOUNDEFINED) bin_PROGRAMS = tesseract tesseract_SOURCES = tesseractmain.cpp @@ -105,5 +105,5 @@ libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32 endif if ADD_RT -tesseract_LDADD += -lrt +tesseract_LDADD += endif diff -ruN tesseract-4.1.1/src/api/Makefile.in tesseract-4.1.1-android/src/api/Makefile.in --- tesseract-4.1.1/src/api/Makefile.in 2019-12-29 07:09:40.275394645 +0900 +++ tesseract-4.1.1-android/src/api/Makefile.in 2019-12-29 07:12:16.559185386 +0900 @@ -92,7 +92,7 @@ @VISIBILITY_TRUE@am__append_9 = -DTESS_IMPORTS @T_WIN_TRUE@am__append_10 = -lws2_32 @T_WIN_TRUE@am__append_11 = -no-undefined -Wl,--as-needed -lws2_32 -@ADD_RT_TRUE@am__append_12 = -lrt +@ADD_RT_TRUE@am__append_12 = subdir = src/api DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/tess_version.h.in $(top_srcdir)/config/depcomp \ @@ -419,7 +419,7 @@ wordstrboxrenderer.cpp renderer.cpp libtesseract_la_LDFLAGS = $(LEPTONICA_LIBS) $(OPENCL_LDFLAGS) \ $(libarchive_LIBS) $(libcurl_LIBS) $(TENSORFLOW_LIBS) \ - -version-info $(GENERIC_LIBRARY_VERSION) $(NOUNDEFINED) \ + -avoid-version $(NOUNDEFINED) \ $(am__append_11) libtesseract_la_SOURCES = # Dummy C++ source to cause C++ linking. diff -ruN tesseract-4.1.1/src/lstm/lstm.cpp tesseract-4.1.1-android/src/lstm/lstm.cpp --- tesseract-4.1.1/src/lstm/lstm.cpp 2019-12-26 23:21:51.000000000 +0900 +++ tesseract-4.1.1-android/src/lstm/lstm.cpp 2019-12-29 07:10:04.488362217 +0900 @@ -33,6 +33,10 @@ #include "networkscratch.h" #include "tprintf.h" +#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID) +extern double log2(double n); +#endif // _MSC_VER + // Macros for openmp code if it is available, otherwise empty macros. #ifdef _OPENMP #define PARALLEL_IF_OPENMP(__num_threads) \ diff -ruN tesseract-4.1.1/src/lstm/weightmatrix.cpp tesseract-4.1.1-android/src/lstm/weightmatrix.cpp --- tesseract-4.1.1/src/lstm/weightmatrix.cpp 2019-12-26 23:21:51.000000000 +0900 +++ tesseract-4.1.1-android/src/lstm/weightmatrix.cpp 2019-12-29 07:10:04.488362217 +0900 @@ -23,6 +23,10 @@ #include "statistc.h" #include "tprintf.h" +#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID) +extern double log2(double n); +#endif // _MSC_VER + namespace tesseract { #if defined(ANDROID) diff -ruN tesseract-4.1.1/src/training/fileio.cpp tesseract-4.1.1-android/src/training/fileio.cpp --- tesseract-4.1.1/src/training/fileio.cpp 2019-12-26 23:21:51.000000000 +0900 +++ tesseract-4.1.1-android/src/training/fileio.cpp 2019-12-29 07:10:04.487362218 +0900 @@ -19,7 +19,6 @@ #include #endif #else -#include #include #endif @@ -119,16 +118,7 @@ } #else bool File::DeleteMatchingFiles(const char* pattern) { - glob_t pglob; - char **paths; - bool all_deleted = true; - if (glob(pattern, 0, nullptr, &pglob) == 0) { - for (paths = pglob.gl_pathv; *paths != nullptr; paths++) { - all_deleted &= File::Delete(*paths); - } - globfree(&pglob); - } - return all_deleted; + return false; } #endif