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

--
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/56FAC55D.5030404%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--- origsrc/tesseract-3.04.00/ccutil/ambigs.cpp 2015-07-11 09:53:12.000000000 
+0200
+++ ccutil/ambigs.cpp   2015-12-11 16:00:23.087012800 +0100
@@ -24,13 +24,13 @@
 #include "helpers.h"
 #include "universalambigs.h"
 
-#if defined _WIN32 || defined(__CYGWIN__)
+#if defined _WIN32 
 #ifndef __GNUC__
 #define strtok_r strtok_s
 #else
 #include "strtok_r.h"
 #endif  /* __GNUC__ */
-#endif  /* _WIN32 __CYGWIN__*/
+#endif  /* _WIN32 */
 
 namespace tesseract {
 
--- origsrc/tesseract-3.04.00/configure.ac      2015-07-11 09:53:12.000000000 
+0200
+++ configure.ac        2015-12-11 16:00:23.102013700 +0100
@@ -88,7 +88,7 @@ case "${host_os}" in
         ;;
     cygwin*)
         AM_CONDITIONAL(ADD_RT, false)
-        AM_CONDITIONAL(T_WIN, true)
+        AM_CONDITIONAL(T_WIN, false)
         AC_SUBST([AM_LDFLAGS], ['-Wl,-no-undefined -Wl,--as-needed'])
         ;;
     solaris*)
--- origsrc/tesseract-3.04.00/training/pango_font_info.cpp      2015-07-11 
09:53:12.000000000 +0200
+++ training/pango_font_info.cpp        2015-12-11 16:00:23.158016900 +0100
@@ -18,6 +18,7 @@
  **********************************************************************/
 
 // Include automatically generated configuration file if running autoconf.
+#define _GNU_SOURCE
 #ifdef HAVE_CONFIG_H
 #include "config_auto.h"
 #endif
Binary files origsrc/tesseract-3.04.01/training/.pango_font_info.cpp.swp and 
src/tesseract-3.04.01/training/.pango_font_info.cpp.swp differ
--- origsrc/tesseract-3.04.01/training/pango_font_info.cpp      2016-02-25 
19:18:25.769148100 +0100
+++ training/pango_font_info.cpp        2016-02-25 19:28:47.845718600 +0100
@@ -23,11 +23,11 @@
 #include "config_auto.h"
 #endif
 
-#if (defined MINGW) || (defined __CYGWIN__)
+#if (defined MINGW) 
 // workaround for stdlib.h and putenv
 #undef __STRICT_ANSI__
 #include "strcasestr.h"
-#endif  // MINGW/Cygwin
+#endif  // MINGW
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
--- api/Makefile.am     2012-10-09 19:18:39.000000000 +0200
+++ api/Makefile.am     2015-01-02 22:59:50.338867400 +0100
@@ -59,7 +59,7 @@ libtesseract_la_LIBADD = \
     ../viewer/libtesseract_viewer.la \
     ../ccutil/libtesseract_ccutil.la
 
-libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION)
+libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION) 
-no-undefined
 
 bin_PROGRAMS = tesseract
 tesseract_SOURCES = $(top_srcdir)/api/tesseractmain.cpp

Reply via email to