On Thu, Feb 9, 2012 at 1:32 PM, TyDam' <[email protected]> wrote:
> Thanks for your answer.
> I already read and have a look on this project.
> Without modification this project compil and run but when I modify it
> by adding:
>
> tesseract::ResultIterator *ri;
> ri=api.GetIterator();
> char * out2 = ri->GetUTF8Text(tesseract::RIL_SYMBOL);
>
> and when I compil his project with this modification I have the same
> error :
>
> error LNK2019: unresolved external symbol "public: char * __thiscall
> tesseract::ResultIterator::GetUTF8Text(enum
> tesseract::PageIteratorLevel)const " (?
> GetUTF8Text@ResultIterator@tesseract@@QBEPADW4PageIteratorLevel@2@@Z)
> referenced in function _main
>
> As his package don't have .lig and dll file I use mine... and I think
> that the problem come from my files.
> Is there a package available with all lib and dll? I never find
> something like that...

I've just looked at similar issues while creating a VS2008 solution
for tesseract 3.02.

This is a general problem with *any* DLL version of libtesseract. The
libtesseract source files currently *only* export the TessBaseAPI &
STRING classes to DLLs.

It does this by declaring the following in baseapi.h:

  class TESSDLL_API TessBaseAPI {
  ...
  }

and in strngs.h (at least once issue 614 [1] is fixed):

  class CCUTIL_API STRING {
  ...
  }

where TESSDLL_API is defined in baseapi.h as:

   #ifdef TESSDLL_EXPORTS
   #define TESSDLL_API __declspec(dllexport)
   #elif defined(TESSDLL_IMPORTS)
   #define TESSDLL_API __declspec(dllimport)
   #else
   #define TESSDLL_API
   #endif

IF you search around the libtesseract sources, you'll find that no
other classes currently are declared with __declspec(). This, for
example, is why it is currently impossible to build DLL_Debug &
DLL_Release versions of any of the training applications.
'
And it explains why you can't use the ResultIterator when linking to
libtesseract.dll. The current workaround is to link your application
staticly instead. Applications built using the LIB_Debug & LIB_Release
configurations have access to all the "public" libtesseract classes &
functions (which is most of them).

[1] http://code.google.com/p/tesseract-ocr/issues/detail?id=614

-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

Reply via email to