Search code examples
android-ndkcompiler-errorsandroid-2.2-froyotesseractlibjpeg

Error in compiling tesseract


I'm compiling tesseract-android-tools-1.00 by using android-ndk r8b(Tesseract-android-tools contain the android tools for compiling tesseract OCR,Leptonica and Jpeg libraries.)

The README file instructions say that the three libraries are to be put under "external" folder which is under the project folder(here "tesseract-android-tools-1.00" folder). Then the folder structure would be :

tesseract-android-tools-1.00/external/libjpeg/

tesseract-android-tools-1.00/external/tesseract-3.00/

tesseract-android-tools-1.00/external/leptonlib-1.66/

When I run ndk-build under project folder(tesseract-android-tools-1.00 folder),I got the following error.

G:\eclipse\ws\tesseract-android-tools-1.00>ndk-build

Install : libjpeg.so => libs/armeabi/libjpeg.so make: * No rule to make target /jni/com_googlecode_lepttonica_android/stdio/open_memstream.c', needed byobj/local/armeabi/objs/lept/jni/com_googlecode_leptonica_android/stdio/open_memstream.o'. Stop.

Before this error,I've come through some errors such as "**No rules to make target..", "**No target found..,needed by ..". I fixed the errors by modifing the content of tesseract-android-tools-1.00/jni/Android.mk file, from...

.........

# TESSERACT_PATH :=

# LEPTONICA_PATH :=

# LIBJPEG_PATH := "

.........

to...

............

TESSERACT_PATH := external/tesseract-3.00

LEPTONICA_PATH := eclipse/ws/tesseract-android-tools-1.00/external/leptonlib-1.66

LIBJPEG_PATH := g:/eclipse/ws/tesseract-android-tools-1.00/external/libjpeg

...........

I've to do this because I'm using on Windows7 and cannot perform Linux commands as shown in README file...

export TESSERACT_PATH=${PWD}/tesseract-3.00

export LEPTONICA_PATH=${PWD}/leptonlib-1.66

export LIBJPEG_PATH=${PWD}/libjpeg"

Note:I downloaded libjpeg from github ... as a tag of android-2.2.3_r2.1-0


Solution

  • The tesseract-android-tools-1.00 file in the Downloads section is old and doesn't work.

    Instead, you should clone the latest code from the repository using this command:

    git clone https://code.google.com/p/tesseract-android-tools/