patcharats / tesseract-ocr

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

HOWTO: compliation fails due to mismatched linkage #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
someone else posted this fix somewhere, which i found at 4am. can't find it
again now, in the daylight, so here it is again:

PLATFORMS: Various, including opensuse 10.2

PROBLEM: after successful ./configure, make fails due to C/C++ conflicts
such as:

........ previous declaration of ‘.....’ with ‘C++’ linkage
........ conflicts with new declaration with ‘C’ linkage

VERSIONS: various, including tesseract-1.04b.tar.gz

SOLUTION: simple edits two header files

11111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111

# diff -C 3 ./cutil/globals.h~ ./cutil/globals.h
*** ./cutil/globals.h~  2007-05-15 20:13:26.000000000 -0500
--- ./cutil/globals.h   2007-06-16 04:27:42.000000000 -0500
***************
*** 45,53 ****
  extern int debugs[MAXPROC];      /*debug flags */
  extern int plots[MAXPROC];       /*plot flags */
  extern int corners[4];           /*corners of scan window */
  extern int optind;               /*option index */
  extern char *optarg;             /*option argument */
!                                  /*image file name */
  extern char imagefile[FILENAMESIZE];
                                   /* main directory */
  extern char directory[FILENAMESIZE];
--- 45,58 ----
  extern int debugs[MAXPROC];      /*debug flags */
  extern int plots[MAXPROC];       /*plot flags */
  extern int corners[4];           /*corners of scan window */
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
  extern int optind;               /*option index */
  extern char *optarg;             /*option argument */
! #ifdef __cplusplus
! }
! #endif                               /*image file name */
  extern char imagefile[FILENAMESIZE];
                                   /* main directory */
  extern char directory[FILENAMESIZE];

2222222222222222222222222222222222222222222222222222222222222222
2222222222222222222222222222222222222222222222222222222222222222

# diff -C 3 ./cutil/tordvars.h~ ./cutil/tordvars.h
*** ./cutil/tordvars.h~ 2007-05-16 16:33:53.000000000 -0500
--- ./cutil/tordvars.h  2007-06-16 04:25:43.000000000 -0500
***************
*** 39,44 ****
--- 39,46 ----
  extern FILE *correct_fp;                    //correct text
  extern FILE *matcher_fp;

+ extern "C"
+ {
  extern int blob_skip;                       /* Skip to next selection */
  extern int num_word_choices;                /* How many words to keep */
  extern int similarity_enable;               /* Switch for Similarity */
***************
*** 50,55 ****
--- 52,58 ----
  extern int show_bold;                       /* Use bold text */
  extern int display_text;                    /* Show word text */
  extern int display_blocks;                  /* Show word as boxes */
+ }

  extern float overlap_threshold;             /* Overlap Threshold */
  extern float certainty_threshold;           /* When to quit looking */

Original issue reported on code.google.com by z23r...@gmail.com on 16 Jun 2007 at 9:57

GoogleCodeExporter commented 9 years ago
Hi,

Thos patches fixed build of Tesseract SVN (r72) on Ubuntu Gutsy Gibbon x86. 
Could you
please commit them ? I attached the diffs (apply with patch -p0) in the case it 
might
help you. (It's just a copy/past).

Regards.

Original comment by bers...@gmail.com on 28 Jun 2007 at 2:06

Attachments:

GoogleCodeExporter commented 9 years ago
hi bersace, perhaps someone on the development team will commit them (i'm not 
part of
the development team).  glad my little help message helped. 

Original comment by z23r...@gmail.com on 28 Jun 2007 at 2:41

GoogleCodeExporter commented 9 years ago
This will be fixed properly in v2.0

Original comment by theraysm...@gmail.com on 7 Jul 2007 at 1:16

GoogleCodeExporter commented 9 years ago

Original comment by theraysm...@gmail.com on 18 Jul 2007 at 10:39

GoogleCodeExporter commented 9 years ago
excellent, thks!

Original comment by z23r...@gmail.com on 19 Jul 2007 at 12:58