sbmbeng / tesseract-ocr

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

Redefinition errors between leptonica and capi #1313

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Attempting to build a simple C program using:

#include "allheaders.h" from leptonica 1.71 
#include "capi.h" from tesseract latest produces the following:

/usr/local/include/leptonica/pix.h:138:20: warning: redefinition of typedef 
'PIX' is a C11 feature [-Wtypedef-redefinition]
typedef struct Pix PIX;
                   ^
/usr/local/Cellar/tesseract/3.02.02_2/include/tesseract/capi.h:69:20: note: 
previous definition is here
typedef struct Pix PIX;

/usr/local/include/leptonica/pix.h:417:21: warning: redefinition of typedef 
'PIXA' is a C11 feature [-Wtypedef-redefinition]
typedef struct Pixa PIXA;
                    ^
/usr/local/Cellar/tesseract/3.02.02_2/include/tesseract/capi.h:71:21: note: 
previous definition is here
typedef struct Pixa PIXA;

                    ^
/usr/local/include/leptonica/pix.h:451:22: warning: redefinition of typedef 
'BOXA' is a C11 feature [-Wtypedef-redefinition]
typedef struct Boxa  BOXA;
                     ^
/usr/local/Cellar/tesseract/3.02.02_2/include/tesseract/capi.h:70:21: note: 
previous definition is here
typedef struct Boxa BOXA;

This was brought up a while back in ticket 881, which seems to indicate that 
capi wouldn't be dependent upon leptonica. Removing the #include "allheaders.h" 
line produces:

/Users/dgaffey/Projects/tesseract-ocr/tessy.c:163:15: warning: implicit 
declaration of function 'pixRead' is invalid in C99 
[-Wimplicit-function-declaration]
    if((img = pixRead(data_path)) == NULL)

/Users/dgaffey/Projects/tesseract-ocr/tessy.c:181:5: warning: implicit 
declaration of function 'pixDestroy' is invalid in C99
      [-Wimplicit-function-declaration]
    pixDestroy(&img);

Which could very well mean that there are replacement functions for pixRead and 
pixDestroy in capi.h or another file that I am unaware of, what confusing 
though is that https://code.google.com/p/tesseract-ocr/wiki/APIExample would 
suggest that this the default set of includes to provide the ocr functionality 
for a C program

Original issue reported on code.google.com by dan.gaf...@giftcards.com on 15 Sep 2014 at 8:44

GoogleCodeExporter commented 9 years ago
Can you please provide testing case for this and some other details? E.g. 
tessy.c, how you compile it, compiler&OS version...

Original comment by zde...@gmail.com on 19 Sep 2014 at 11:46

GoogleCodeExporter commented 9 years ago
Closed because of missing input from reporter

Original comment by zde...@gmail.com on 22 Apr 2015 at 8:00