building training tools on cygwin

89 views
Skip to first unread message

ShreeDevi Kumar

unread,
Mar 29, 2016, 1:50:25 PM3/29/16
to tesser...@googlegroups.com
Hi,

I have been able to build latest source of tesseract on cygwin.

ra@Shree ~/tesseract-ocr/tesseract
$ tesseract -v
tesseract 3.05.00dev-296-g60176fc
 leptonica-1.73
  libgif 4.1.6(?) : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.6.20 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.3

However, make training is failing with the following error:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -g -Wall -Wno-uninitialized -O0 -DDEBUG -DUSE_STD_NAMESPACE -DPANGO_ENABLE_ENGINE -I../ccmain -I../api -I../ccutil -I../ccstruct -I../viewer -I../textord -I../dict -I../classify -I../display -I../wordrec -I../cutil -I../vs2010/port -I/usr/local/include/leptonica -I/usr/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -std=gnu++11 -MT pango_font_info.lo -MD -MP -MF .deps/pango_font_info.Tpo -c pango_font_info.cpp  -DDLL_EXPORT -DPIC -o .libs/pango_font_info.o
In file included from /usr/include/stdlib.h:11:0,
                 from pango_font_info.cpp:30:
/usr/include/string.h:76:7: error: conflicting declaration of ‘char* strcasestr(const char*, const char*)’ with ‘C’ linkage
 char *_EXFUN(strcasestr,(const char *, const char *));
       ^
In file included from pango_font_info.cpp:28:0:
../vs2010/port/strcasestr.h:57:7: note: previous declaration with ‘C++’ linkage
 char *strcasestr(const char *haystack, const char *needle);

This is with source as of latest commit:

commit 60176fc5ae5e7f6bdef60c926a4b5ea03de2bfa7
    replace __CYGWIN32__ with __CYGWIN__

Has anyone else built the latest version on cygwin? What dependencies and versions did you use?

Thanks!

Marco Atzeri

unread,
Mar 29, 2016, 2:12:01 PM3/29/16
to tesser...@googlegroups.com


On 29/03/2016 19:49, ShreeDevi Kumar wrote:
> Hi,
>
> I have been able to build latest source of tesseract on cygwin.
>
> ra@Shree ~/tesseract-ocr/tesseract
> $ tesseract -v
> tesseract 3.05.00dev-296-g60176fc
> leptonica-1.73
> libgif 4.1.6(?) : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.6.20 :
> libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.3
>
> However, make training is failing with the following error:
>
> libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -g -Wall
> -Wno-uninitialized -O0 -DDEBUG -DUSE_STD_NAMESPACE -DPANGO_ENABLE_ENGINE
> -I../ccmain -I../api -I../ccutil -I../ccstruct -I../viewer -I../textord
> -I../dict -I../classify -I../display -I../wordrec -I../cutil
> -I../vs2010/port -I/usr/local/include/leptonica -I/usr/include/leptonica
> -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1
> -I/usr/include/freetype2 -I/usr/include/libpng16
> -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -std=gnu++11 -MT
> pango_font_info.lo -MD -MP -MF .deps/pango_font_info.Tpo -c
> pango_font_info.cpp -DDLL_EXPORT -DPIC -o .libs/pango_font_info.o
> In file included from /usr/include/stdlib.h:11:0,
> from pango_font_info.cpp:30:
> */usr/include/string.h:76:7: error: conflicting declaration of ‘char*
> strcasestr(const char*, const char*)’ with ‘C’ linkage*
> * char *_EXFUN(strcasestr,(const char *, const char *));*
> ^
> In file included from pango_font_info.cpp:28:0:
> ../vs2010/port/strcasestr.h:57:7: note: previous declaration with ‘C++’
> linkage
> char *strcasestr(const char *haystack, const char *needle);
>
> This is with source as of latest commit:
>
> commit 60176fc5ae5e7f6bdef60c926a4b5ea03de2bfa7
> replace __CYGWIN32__ with __CYGWIN__
>
> Has anyone else built the latest version on cygwin? What dependencies
> and versions did you use?
>
> Thanks!

Attached the two patches I used for 3.04.01,
I assume you need also for dev, but I have not tested.

Regards
Marco

tesseract-training.patch
tesseract-undefined.patch

shree

unread,
Apr 3, 2016, 3:09:21 AM4/3/16
to tesseract-ocr
Marco,

Thanks for the patches. I wasn't able to build with dev. 
Please provide the patches as a pull request for the project, when you build it next time.

Thanks.

Marco Atzeri

unread,
Apr 3, 2016, 12:36:16 PM4/3/16
to tesser...@googlegroups.com
On 03/04/2016 09:09, shree wrote:
> Marco,
>
> Thanks for the patches. I wasn't able to build with dev.
> Please provide the patches as a pull request for the project, when you
> build it next time.
>
> Thanks.
>

hi Shree,
strange.
I just built from dev with the two patches, that applied fine.

tesseract-training.patch
tesseract-undefined.patch

Two additional notes:
- I always run "autoreconf -ivf"
- To correctly manage the i18n libs, I need
configure LIBS="$(pkg-config --libs icu-i18n)"

Regards
Marco
Reply all
Reply to author
Forward
0 new messages