karldergrosse / tesseract-ocr

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

[ 1586031 ] tesseract-1.02 vs NetBSD/amd64: problems and fixes #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Thomas Klausner - thomasklausner(sf)

I compiled tesseract-1.02 on NetBSD-4.99.3/amd64, and
had some trouble because
gcc (GCC) 4.1.2 20061021 prerelease (NetBSD nb1 20061021)
complained about two kinds of problem:
Mixing "C" linkage with "C++" linkage and casting
pointers to ints, which "loses precision". Pointers are
64bit wide, ints only 32bit.
Additionally, ccutil/platform.h tries to include a
Linux-specific header file, linux/limits.h. Using
limits.h instead seems to work fine.
Since I started with tesseract-1.0, I also have a patch
to fix the path to the xterm executable -- on NetBSD it
is in /usr/X11R6/bin, not in /usr/bin/X11.
Please apply these or similar patches (I can test if
you want).

Comments

Date: 2006-12-25 08:39
Sender: thomasklausner
Logged In: YES 
user_id=205695
Originator: YES

Thanks for the pointer to the bokeoa-64bit-branch of tesseract.
I tested the version from Dec 2.

First, regarding linux/limits.h -- on the Linux system
to which I have access, limits.h also exists, and AFAIK
limits.h is the POSIX header for the corresponding symbols.
So perhaps you could replace "linux/limits.h" with a plain
"limits.h" in ccutil/platform.h.

As for compilation of tesseract itself, here's the output
after the change described above:

../cutil/globals.h:47: error: previous declaration of 'char* optarg' with
'C++' linkage
/usr/include/unistd.h:154: error: conflicts with new declaration with 'C'
linkage
../cutil/globals.h:46: error: previous declaration of 'int optind' with
'C++' linkage
/usr/include/unistd.h:156: error: conflicts with new declaration with 'C'
linkage

This is fixed by adding
        extern "C" {
        }
around the optind and optarg lines in cutils/globals.h.
The same is needed for displayargs in cutils/tord.h.

With the attached diffs, tesseract compiles (with a lot of compilation
warnings, details on request), and works with phototest.tif on
NetBSD-4.99.4/amd64! Cool!
File Added: tesseract.diff

Date: 2006-12-01 15:30
Sender: bokeoa
Logged In: YES 
user_id=1340826
Originator: NO

Thomas,

Try the bokeoa-64bit-branch from CVS and see if it fixes your amd64
problems.  I looked at your patch and it looks specific to NetBSD,
if you can redo it so that it would work on both NetBSD and Linux,
I'll do what I can to get it included.

Bryan

Original issue reported on code.google.com by tmb...@gmail.com on 7 Mar 2007 at 10:27

GoogleCodeExporter commented 9 years ago

Original comment by tmb...@gmail.com on 7 Mar 2007 at 10:35

GoogleCodeExporter commented 9 years ago
I don't see that 64-bit branch in the Subersion repository.  Has it already been
merged into the trunk?

Original comment by space...@gmail.com on 24 Apr 2007 at 11:53

GoogleCodeExporter commented 9 years ago
This issue is fixed in 1.04. There is no 64 bit branch. We are aiming at 
keeping the
main branch portable.

Original comment by theraysm...@gmail.com on 17 May 2007 at 6:36