Errors building Tesseract for Android on Mac

84 views
Skip to first unread message

codefully

unread,
May 6, 2015, 8:22:34 AM5/6/15
to tesser...@googlegroups.com
I have tried to build Tesseract for Android on a mac several times but keep getting errors. I followed the steps below:

tar -zxvf tesseract-ocr-3.02.02.tar.gz
tar -zxvf leptonica-1.69.tar.gz
rm -f tesseract-ocr-3.02.02.tar.gz
rm -f leptonica-1.69.tar.gz
mv tesseract-3.02.02 jni/com_googlecode_tesseract_android/src
mv leptonica-1.69 jni/com_googlecode_leptonica_android/src
ndk-build -j8
android update project --target 1 --path .
ant debug (release)

Whenever I get to the ndk-build -j8 step I get the following errors:

jni/com_googlecode_tesseract_android/src/dict/permdawg.cpp: In member function 'void tesseract::Dict::go_deeper_dawg_fxn(char const*, const BLOB_CHOICE_LIST_VECTOR&, int, const CHAR_FRAGMENT_INFO*, bool, WERD_CHOICE*, float*, float*, WERD_CHOICE*, int*, void*)':

jni/com_googlecode_tesseract_android/src/dict/permdawg.cpp:208:62: error: format not a string literal and no format arguments [-Werror=format-security]

Compile++ thumb  : tess <= states.cpp

cc1plus: some warnings being treated as errors


make: *** [obj/local/armeabi/objs/tess/src/dict/permdawg.o] Error 1

make: *** Waiting for unfinished jobs....


How can I solve this?

Allistair

unread,
May 6, 2015, 8:23:55 AM5/6/15
to tesser...@googlegroups.com
When I did this I followed a tutorial that said you have to use an older version of the NDK - are you using the latest?

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/b886506c-1436-4ea5-ac3f-2f832da56a7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

codefully

unread,
May 6, 2015, 8:30:49 AM5/6/15
to tesser...@googlegroups.com
I am using v9, or should I be using a version older than v9? The current version is 10.

Allistair

unread,
May 6, 2015, 8:37:50 AM5/6/15
to tesser...@googlegroups.com
Here were my notes:

Leptonica & Tesseract native libraries

In order to use Tesseract with Android we must use the work of the tess-two fork project of the android-tools


First, Android NDK 10c must be installed. NDK is used to work with native C/C++ libraries on Android.


We obtained the NDK 10c bin and installed it on our Mac OS X development machine by extracting to /Applications. The path to the NDK was also added to the system environment variable PATH, i.e.


export PATH=$PATH:/Applications/android-ndk-r10c


Now tess-two was cloned:


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


And, moving into folder tess/tess-two, execution of ndk-build resulted in a src folder and a libs folder with Java sourcs and architecture-dependent folders with compiled libraries for liblept.so and libtess.so respectively.



codefully

unread,
May 6, 2015, 8:55:18 AM5/6/15
to tesser...@googlegroups.com
So once I am able to build tess-two I can use it as a library in my Tesseract project.

Allistair

unread,
May 6, 2015, 9:37:37 AM5/6/15
to tesser...@googlegroups.com
Yes, here is more of my notes:

And, moving into folder tess/tess-two, execution of ndk-build resulted in a src folder and a libs folder with Java sourcs and architecture-dependent folders with compiled libraries for liblept.so and libtess.so respectively.

The src com folder was copied into the project main/java folder and the libs folder was copied to the project’s main folder and renamed jniLibs. Finally a synchronisation of the main folder was done in Android Studio.


Reply all
Reply to author
Forward
0 new messages