How to link Tesseract with Eclipse CDT under Windows

1,112 views
Skip to first unread message

Yasser Almehio

unread,
Sep 12, 2013, 4:40:30 AM9/12/13
to tesser...@googlegroups.com
I'm familiar with opencv under Eclipse (MingW) + Windows . I have Opencv and Eclipse already installed working well. I'd like to integrate the stuff of Tesseract with Eclipse under windows. I read the wiki docs and many others. Actually I found two different ways to integrate it, one is to generate dlls, and so they are used in our projects, or to use API by including .h files of tesseract.


Anyway I could not integrate tesseract functions in my opencv projects.

My trial:

According to this link ,


  • I downloaded the Tesseract and leptonica libs to a directory , it contains the following:

C:\CBuildFolderTess\
 include\
  leptonica\
  tesseract\

  leptonica_versionnumbers.vsprops
  tesseract_versionnumbers.vsprops

lib\
 giflib416-static-mtdll-debug.lib
 giflib416-static-mtdll.lib
 libjpeg8c-static-mtdll-debug.lib
 libjpeg8c-static-mtdll.lib
 liblept168-static-mtdll-debug.lib
 liblept168-static-mtdll.lib
 liblept168.dll
 liblept168.lib
 liblept168d.dll
 liblept168d.lib
 libpng143-static-mtdll-debug.lib
 libpng143-static-mtdll.lib
 libtesseract302.dll
 libtesseract302.lib
 libtesseract302d.dll
 libtesseract302d.lib
 libtesseract302-static.lib
 libtesseract302-static-debug.lib
 libtiff394-static-mtdll-debug.lib
 libtiff394-static-mtdll.lib
 zlib125-static-mtdll-debug.lib
 zlib125-static-mtdll.lib

  • Then I configured Eclipse as the following: I Created a new C++ project : File > New > C++ Project Choose a Hello Word Project.

  • I went to the Project Properties >> C/C++ Build >> Settings on the Tool Setting tab >> GCC C++ Compiler >> Includes and put the include directory path [C:\ \CBuildFolderTess\include], [C:\CBuildFolderTess\include\leptonica] and [C:\ CBuildFolderTess\include\tesseract] Then, I went to to MinGW C++ Linker >> Libraries and added the Library search path [C:\ \CBuildFolderTess\lib] and added the next libraries: libtesseract302d, libtesseract302

  • I wrote a simple program and included :

    • baseapi.h
      

    and

      allheaders.h.


    BUT it can't build because of a lot of errors , such:

    *C:\CBuildFolderTess\include\tesseract/platform.h:30:3: error: 'BLOB' has a previous declaration as 'typedef struct _BLOB BLOB' } BLOB, LPBLOB; ^ In file included from c:\mingw\include\unknwn.h:38:0,from c:\mingw\include\commdlg.h:532, from c:\mingw\include\windows.h:87, from C:\CBuildFolderTess\include\tesseract/host.h:65, from C:\CBuildFolderTess\include\tesseract/tesscallback.h:22, from C:\CBuildFolderTess\include\tesseract/baseapi.h:31, from ..\src\test4.cpp:13: c:\mingw\include\wtypes.h:47:16: error: conflicting declaration 'typedef int LPBLOB'* } BLOB,*PBLOB,*LPBLOB;

    Did I do a mistakes upon linking? someone can propose solution the do the linking properly ?

zdenko podobny

unread,
Sep 12, 2013, 5:07:29 AM9/12/13
to tesser...@googlegroups.com
Quick reply:  AFAIR it should be fixed in current svn. If you have problem try to use -D__BLOB_T_DEFINED[1].

Anyway - linking MSVC++ dlls to mingw project is IMO bad idea. I would suggest you to compile tesseract with mingw ([2], [3]).

--
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-oc...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
 
---
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 tesseract-oc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages