karldergrosse / tesseract-ocr

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

[ 1553105 ] Doesn't compile on Fedora Core 6 (test 3) #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Kurt Heine - kheine7(sf)

When I try to compile under Fedora Core 6 Test 3 I get
the following errors.

The following are versions of software :
gcc-4.1.1-20
libstdc++-4.1.1-20

I have included the output for the configure and make.

Comments

Date: 2006-09-18 16:50
Sender: niver
Logged In: YES 
user_id=299896

I think it's only gcc-4.1 choking on the code, gcc-4.0.1
works just fine.

Anyway, adding a few 
extern "C" { }
here and there seems to be a correct workaround

ccmain/control.cpp, line 152
extern "C" { extern int display_ratings; }

cutil/tordvars.h, line 48
extern "C" { extern int display_ratings; }

cutil/globals.h, line 47
extern "C" {
   extern int optind;               /*option index */
   extern char *optarg;             /*option argument */
}

ccutil/getopt.h, line 23
extern "C" {
   extern int optind;
   extern char *optarg;
}

This should do it. At least it did for me.

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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
The patch also fixes the build for SuSE 10.2 (also comes with GCC 4.1)

Original comment by adigu...@gmail.com on 11 Apr 2007 at 8:41

GoogleCodeExporter commented 9 years ago
I fixed the getopt problem another way in 1.04.
Can somebody with this OS please find out what display_ratings is colliding 
with?

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

GoogleCodeExporter commented 9 years ago
My system is: 2.6.19-1.2911.6.5.fc6 (Fedora 6)

The previous declaration is happening at tfacep.h:106.

../cutil/tordvars.h:49: error: previous declaration of ‘int 
display_ratings’ with
‘C++’ linkage
tfacep.h:106: error: conflicts with new declaration with ‘C’ linkage

Original comment by rsrip...@gmail.com on 23 May 2007 at 5:23

GoogleCodeExporter commented 9 years ago
FC6 updated yesterday:
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I../ccstruct -I../ccutil -I../cutil
-I../classify -I../image -I../dict -I../viewer   -g -O2 -MT tface.o -MD -MP -MF
".deps/tface.Tpo" -c -o tface.o tface.cpp; \
        then mv -f ".deps/tface.Tpo" ".deps/tface.Po"; else rm -f ".deps/tface.Tpo";
exit 1; fi
../cutil/globals.h:49: ошибка: previous declaration of ‘char* optarg’ 
with ‘C++’ linkage
/usr/include/getopt.h:59: ошибка: conflicts with new declaration with 
‘C’ linkage
../cutil/globals.h:48: ошибка: previous declaration of ‘int optind’ 
with ‘C++’ linkage
/usr/include/getopt.h:73: ошибка: conflicts with new declaration with 
‘C’ linkage

Original comment by ti.eug...@gmail.com on 24 May 2007 at 8:03

GoogleCodeExporter commented 9 years ago
----
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I../ccutil -I../ccstruct -I../image 
-I../viewer
-I../ccops -I../dict -I../classify -I../display -I../wordrec -I../cutil 
-I../textord
  -g -O2 -MT tessedit.o -MD -MP -MF ".deps/tessedit.Tpo" -c -o tessedit.o tessedit.cpp; \
        then mv -f ".deps/tessedit.Tpo" ".deps/tessedit.Po"; else rm -f
".deps/tessedit.Tpo"; exit 1; fi
../cutil/tordvars.h:49: ошибка: previous declaration of ‘int 
display_ratings’ with
‘C++’ linkage
tfacep.h:106: ошибка: conflicts with new declaration with ‘C’ linkage
----
I did this (in tordvars.h):
----
extern "C" { extern int display_ratings; }  /* Show the ratings */
//extern int display_ratings;                 /* Show the ratings */
----
Compiled OK, but not works:
----
$ ./tesseract phototest.tif phototest

Error: Unable to open unicharset!

Fatal error: No error trap defined!
Signal_termination_handler called with signal 3000
Signal_exit 30 SIGNAL ABORT. LocCode: 3  SignalCode: 3
----

Original comment by ti.eug...@gmail.com on 24 May 2007 at 8:31

GoogleCodeExporter commented 9 years ago

I also have this error.  I have found the problem to be that tesseract is 
loading 
the data file path incorrectly.... it is set to the below text.

open("/usrtessdata/eng.unicharset", O_RDONLY) = -1 ENOENT (No such file or 
directory)
write(2, "\nError: Unable to open unicharse"..., 35
Error: Unable to open unicharset!

I am assuming that creating a symlink for /usrtessdata/ with 
/usr/share/tessdata 
will work correctly.  Should we not have used make install yet? or is there 
something else that I should have set?

After creating the symlink to make the file appear tess runs, but runs for 
10+mins 
on the sample tif that comes with it.  I have another server running slackware 
10.2 
and it works fine on that.  I can just use that, but would prefer to get tess 
running on this version of Linux.

[ibrown@dontpatronize ccmain]$ uname -a
Linux dontpatronize.us 2.6.9-023stab043.1-enterprise #1 SMP Mon Mar 5 16:58:09 
MSK 
2007 i686 i686 i386 GNU/Linux

strace tesseract phototest.tif phototest.txt
execve("/usr/bin/tesseract", ["tesseract", "phototest.tif", "phototest.txt"], 
[/* 23 
vars */]) = 0
uname({sys="Linux", node="dontpatronize.us", ...}) = 0
brk(0)                                  = 0x817b000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=36573, ...}) = 0
old_mmap(NULL, 36573, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fdf000
close(3)                                = 0
open("/usr/lib/libtiff.so.3", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\250F\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=748873, ...}) = 0
old_mmap(NULL, 304836, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7f94000
old_mmap(0xb7fdc000, 12288, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x47000) = 0xb7fdc000
close(3)                                = 0
open("/usr/lib/libstdc++.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\266\3"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=792856, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7f93000
old_mmap(NULL, 818920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7ecb000
old_mmap(0xb7f89000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xbd000) = 0xb7f89000
old_mmap(0xb7f8e000, 20200, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f8e000
close(3)                                = 0
open("/lib/tls/libm.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0003\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=211948, ...}) = 0
old_mmap(NULL, 139424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7ea8000
old_mmap(0xb7ec9000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0xb7ec9000
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\350\27"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=38624, ...}) = 0
old_mmap(NULL, 37340, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7e9e000
old_mmap(0xb7ea7000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0xb7ea7000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320N\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1526108, ...}) = 0
old_mmap(NULL, 1227996, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7d72000
old_mmap(0xb7e98000, 16384, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x125000) = 0xb7e98000
old_mmap(0xb7e9c000, 7388, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7e9c000
close(3)                                = 0
open("/usr/lib/libz.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\25"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=62248, ...}) = 0
old_mmap(NULL, 65124, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb7d62000
old_mmap(0xb7d71000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0xb7d71000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7d61000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7d60000
mprotect(0xb7e98000, 8192, PROT_READ)   = 0
mprotect(0xb7ec9000, 4096, PROT_READ)   = 0
mprotect(0xb7ffe000, 4096, PROT_READ)   = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7d606c0, limit:1048575, 
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, 
useable:1}) = 0
munmap(0xb7fdf000, 36573)               = 0
brk(0)                                  = 0x817b000
brk(0x819c000)                          = 0x819c000
mmap2(NULL, 13000704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb70fa000
munmap(0xb70fa000, 13000704)            = 0
open("/usrtessdata/eng.unicharset", O_RDONLY) = -1 ENOENT (No such file or 
directory)
write(2, "\nError: Unable to open unicharse"..., 35
Error: Unable to open unicharset!
) = 35
write(2, "\nFatal error: No error trap defi"..., 37
Fatal error: No error trap defined!
) = 37
write(2, "Signal_termination_handler calle"..., 51Signal_termination_handler 
called 
with signal 3000
) = 51
write(2, "Signal_exit 30 SIGNAL ABORT. Loc"..., 55Signal_exit 30 SIGNAL ABORT. 
LocCode: 3  SignalCode: 3
) = 55
exit_group(30)                          = ?
Process 28648 detached
[ibrown@dontpatronize tesseract-1.04]$

Original comment by ichi.br...@gmail.com on 30 May 2007 at 6:39

GoogleCodeExporter commented 9 years ago
even downgrading to 1.04a doesn't resolve the issue.  still hangs on 
phototest.tif.

Original comment by ichi.br...@gmail.com on 30 May 2007 at 6:48

GoogleCodeExporter commented 9 years ago
Subversion copy worked fine withou make install will manually copy files over.

Original comment by ichi.br...@gmail.com on 30 May 2007 at 7:00

GoogleCodeExporter commented 9 years ago
hello :)
 I've got the same problem, i'm using Fedora core 6

my system is  2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686 athlon 
i386
GNU/Linux

my gcc version is : gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)

but the bug is the same as yours, like that :

../cutil/globals.h:49: error: previous declaration of ‘char* optarg’ with 
‘C++’ linkage
/usr/include/getopt.h:59: error: conflicts with new declaration with ‘C’ 
linkage
../cutil/globals.h:48: error: previous declaration of ‘int optind’ with 
‘C++’ linkage
/usr/include/getopt.h:73: error: conflicts with new declaration with ‘C’ 
linkage

but i don't know how to fix it, anyone have a idea please ?
I see response of ichi.brown, like using svn version, but you sugest to just 
copy the
files, by what files ?

snakeman

Original comment by cis.snak...@gmail.com on 4 Jun 2007 at 12:11

GoogleCodeExporter commented 9 years ago
Hum... :/

i've got the same error, using the svn installation process wich it describe :

svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
./configure
make
make install

same error like before >.<
i'll try using autoconf, it's my last chance... ;)

Original comment by cis.snak...@gmail.com on 4 Jun 2007 at 12:36

GoogleCodeExporter commented 9 years ago
To solve my problem with my Fedora Core 6, i've moved to Ubuntu 7.04, lol xD

Dear ichi.brown,

I found a way to fix this bug : Error: Unable to open unicharset!

In fact you must copy the >eng.unicharset< file from
/your_unziped_tesseract_directory/tessdata/ onto your /tessdata/ default 
directory
after install (for mine /usr/local/bin/tessdata)

Perhaps you need tou make a symbolic link with two directory :
from  your default tesseract binaries to your tessdata directory with using <ln 
-st
from target>
For example i've must do :
ln -st /usr/local/bin/ /usr/local/share/tessdata/

i think it will be ok after that ;)

Snakeman

Original comment by cis.snak...@gmail.com on 5 Jun 2007 at 12:54

GoogleCodeExporter commented 9 years ago
fwiw:

snake: tru i had that same thought in my head at this second... man i should 
just 
run ubuntu and home, process data then send to CentOS machine.

A lot of times running strace cmd will give you good diagnostic output to play 
with 
while you're waiting on replies and such or prior to posting the reply, it can 
also 
help out a lot in determing what the problem is, for people to just observe... 
For 

Example: when i started playing with strace to determine the problem, i 
noticed "File not Found".  So i said oh it's not there, what's not there.  etc.

that's how i found out that something wasn't moved and it gave me a quick-fix 
solution until something along the bend could arrive.

Sorry for my slow paying attention to this group, honestly i worked on this 
parser 
pretty hard for when the img was text.  heh.

-i
http://doj.dontpatronize.us/

Original comment by ibrown%d...@gtempaccount.com on 16 Jun 2007 at 7:38

GoogleCodeExporter commented 9 years ago
The following discussion at debian.org may be of interest:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=409673
http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=tesseract&sev-inc=cr
itical&sev-inc=grave&sev-inc=serious

Quote:

Your package fails to build with recent versions of the gcc-snapshot
package, i.e. a pre-release of GCC 4.2.  The problem is that external
variables are defined both in a C and C++ context, as you can see in
this simple example:

42059:tbm@deprecation: ~] /usr/lib/gcc-snapshot/bin/g++ -c t.cc
t.cc:1: error: previous declaration of 'int i' with 'C++' linkage
t.cc:4: error: conflicts with new declaration with 'C' linkage
42060:tbm@deprecation: ~] cat t.cc
extern int i;

extern "C" {
        extern int i;
}

According to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27227#c8 this
is not valid.

Original comment by spinality on 3 Nov 2007 at 12:40

GoogleCodeExporter commented 9 years ago
On Ubuntu 7.10 (gcc3.3, gcc3.4, gcc4.1, gcc4.2) (I'm pretty newbie, so don't 
know
which gcc-version is used):

Another minor error with build 154 (Fri, 01 Feb 2008). 
For some reason a 'java/makefile' interferes with 'java/Makefile'. Just rename.

Original comment by fsando...@gmail.com on 21 Apr 2008 at 8:39

GoogleCodeExporter commented 9 years ago
I think this issue is finally resolved.

Original comment by theraysm...@gmail.com on 30 Dec 2008 at 9:34

GoogleCodeExporter commented 9 years ago
fraid not...

if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I../ccstruct -I../ccutil -I../cutil 
-I../classify -I../image -I../dict -I../viewer   -DNDEBUG -O3 -Wall -MT tface.o 
-MD -MP -MF ".deps/tface.Tpo" -c -o tface.o tface.cpp; \
    then mv -f ".deps/tface.Tpo" ".deps/tface.Po"; else rm -f ".deps/tface.Tpo"; exit 1; fi
../cutil/globals.h:46: error: previous declaration of ‘int optind’ with 
‘C++’ linkage
../ccutil/getopt.h:23: error: conflicts with new declaration with ‘C’ 
linkage
../cutil/globals.h:47: error: previous declaration of ‘char* optarg’ with 
‘C++’ linkage
../ccutil/getopt.h:24: error: conflicts with new declaration with ‘C’ 
linkage
make[3]: *** [tface.o] Error 1
make[3]: Leaving directory `/home/mwood/src/tesseract-1.03/wordrec'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mwood/src/tesseract-1.03/wordrec'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mwood/src/tesseract-1.03'
make: *** [all] Error 2
[user@admin01 tesseract-1.03]$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Original comment by mwoo...@gmail.com on 2 Mar 2011 at 8:38

GoogleCodeExporter commented 9 years ago
tesseract-1.03??? Did you tried to use recent version (3.00)?

Original comment by zde...@gmail.com on 2 Mar 2011 at 9:50