azzimfarid / tesseract-android-tools

Automatically exported from code.google.com/p/tesseract-android-tools
0 stars 0 forks source link

Error While Building Tesseract Android Tools #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build Tesseract Android tools by following theses link:
http://rmtheis.wordpress.com/2011/08/06/using-tesseract-tools-for-android-to-cre
ate-a-basic-ocr-app/

and

http://code.google.com/p/tesseract-android-tools/source/browse/trunk/tesseract-a
ndroid-tools/README

2. when executing NDK-build, errors occurred
3.

What is the expected output? What do you see instead?
In file included from 
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:17:
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/co
mmon.h:22:24: error: allheaders.h: No such file or directory
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jint 
Java_com_googlecode_leptonica_android_Box_nativeCreate(JNIEnv*, _jclass*, jint, 
jint, jint, jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: 'l_int32' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: expected ')' before 'y'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: expected ')' before 'w'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: expected ')' before 'h'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:27: error: 'boxCreate' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'void 
Java_com_googlecode_leptonica_android_Box_nativeDestroy(JNIEnv*, _jclass*, 
jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:35: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:35: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:35: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:35: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:37: error: 'boxDestroy' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jint 
Java_com_googlecode_leptonica_android_Box_nativeGetX(JNIEnv*, _jclass*, jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:43: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:43: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:43: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:43: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jint 
Java_com_googlecode_leptonica_android_Box_nativeGetY(JNIEnv*, _jclass*, jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:51: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:51: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:51: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:51: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jint 
Java_com_googlecode_leptonica_android_Box_nativeGetWidth(JNIEnv*, _jclass*, 
jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:59: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:59: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:59: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:59: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jint 
Java_com_googlecode_leptonica_android_Box_nativeGetHeight(JNIEnv*, _jclass*, 
jint)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:67: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:67: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:67: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:67: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp: In function 'jboolean 
Java_com_googlecode_leptonica_android_Box_nativeGetGeometry(JNIEnv*, _jclass*, 
jint, _jintArray*)':
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:76: error: 'BOX' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:76: error: 'box' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:76: error: expected primary-expression before ')' token
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:76: error: expected ';' before 'nativeBox'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:78: error: 'l_int32' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:78: error: expected ';' before 'x'
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:80: error: 'x' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:80: error: 'y' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:80: error: 'w' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:80: error: 'h' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:80: error: 'boxGetGeometry' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:84: error: 'x' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:85: error: 'y' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:86: error: 'w' was not declared in this scope
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/bo
x.cpp:87: error: 'h' was not declared in this scope
make: *** 
[/media/00B42E57B42E5008/android-ndk-r6b/obj/local/armeabi/objs/lept//media/00B4
2E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/box.o] Error 1

What version of the product are you using? On what operating system?
I use Ubuntu 11.10 for building my windows 7 shared directory (use Ubuntuk 
Android-ndk to build tesseract on windows 7 folder)

Please provide any additional information below.

I think something wrong with the file box.cpp

Please help me out from those errors.

Any help will be appreciated. Thank you

Original issue reported on code.google.com by apriliap...@gmail.com on 6 Nov 2011 at 6:29

GoogleCodeExporter commented 8 years ago
The problem is solved now, I download leptonica-1.66 to solve the problem. But 
another error occurred :
Compile++ thumb  : lept <= utilities.cpp
//media/00B42E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/ut
ilities.cpp:19:28: error: android/bitmap.h: No such file or directory
make: *** 
[/media/00B42E57B42E5008/android-ndk-r6b/obj/local/armeabi/objs/lept//media/00B4
2E57B42E5008/android-ndk-r6b/jni/com_googlecode_leptonica_android/utilities.o] 
Error 1

I just realized that com_googlecode_leptonica_android directory doesnt contain 
android directory and bitmap.h file

Is something missing there?

Best Regards,

Priska

Original comment by apriliap...@gmail.com on 6 Nov 2011 at 7:25

GoogleCodeExporter commented 8 years ago
Hi 
I am using the same lib leptonlib-1.66 and facing the same kind of error as you 
mentioned in your first comment. But I am not able to come out from this error. 
Please help me and tell how you were able to comeout from this error.

Follwoing error is coming ::

"Compile++ thumb : lept <= box.cpp
In file included from 
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_androi
d\box.cpp:17:
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
/common.h:22:24: err
or: allheaders.h: No such file or directory
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jint Java_com_googlecode_leptonica_android_Box_nativeCreate(JNIEnv*, _jclass*, jint, jint, jint, j
int)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: '
l_int32' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: e
xpected ')' before 'y'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: e
xpected ')' before 'w'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: e
xpected ')' before 'h'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:27: error: '
boxCreate' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'void Java_com_googlecode_leptonica_android_Box_nativeDestroy(JNIEnv*, _jclass*, jint)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:35: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:35: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:35: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:35: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:37: error: '
boxDestroy' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jint Java_com_googlecode_leptonica_android_Box_nativeGetX(JNIEnv*, _jclass*, jint)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:43: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:43: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:43: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:43: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jint Java_com_googlecode_leptonica_android_Box_nativeGetY(JNIEnv*, _jclass*, jint)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:51: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:51: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:51: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:51: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jint Java_com_googlecode_leptonica_android_Box_nativeGetWidth(JNIEnv*, _jclass*, jint)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:59: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:59: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:59: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:59: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jint Java_com_googlecode_leptonica_android_Box_nativeGetHeight(JNIEnv*, _jclass*, jint)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:67: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:67: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:67: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:67: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp: In function
 'jboolean Java_com_googlecode_leptonica_android_Box_nativeGetGeometry(JNIEnv*, _jclass*, jint, _jin
tArray*)':
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:76: error: '
BOX' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:76: error: '
box' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:76: error: e
xpected primary-expression before ')' token
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:76: error: e
xpected ';' before 'nativeBox'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:78: error: '
l_int32' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:78: error: e
xpected ';' before 'x'
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:80: error: '
x' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:80: error: '
y' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:80: error: '
w' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:80: error: '
h' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:80: error: '
boxGetGeometry' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:84: error: '
x' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:85: error: '
y' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:86: error: '
w' was not declared in this scope
jni/com_googlecode_leptonica_android/../../jni/com_googlecode_leptonica_android\
box.cpp:87: error: '
h' was not declared in this scope
make: *** 
[obj/local/armeabi/objs/lept/__/__/jni/com_googlecode_leptonica_android\box.o] 
Error 1

Original comment by naveen1...@gmail.com on 23 Mar 2012 at 1:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi Priska..

I tried With leptonica-1.66 lib as well from the link 
http://code.google.com/p/leptonica/downloads/detail?name=leptonica-1.66-win32-li
b-include-dirs.zip&can=2&q=
but still I am not able to compile. Please let me know the detail steps which 
you followed in building lept lib.
Also, plz let me know whether you integrated leptonica-1.66 seperately along 
with leptonlib  or completely by replacing leptonlib.
Also plz let me know what steps did you followed in modifying Android.mk file. 
I am facing problem in updating that file also 

Please provide me help asap..... 

Original comment by naveen1...@gmail.com on 23 Mar 2012 at 1:53

GoogleCodeExporter commented 8 years ago
Obsolete. Follow instructions in tesseract-android-tools/README.

Original comment by alanv@google.com on 11 Sep 2012 at 8:05