0

I can compile two projects (leptonica and tesseract) under Cygwin successfully (with provided configure+make).

Also, I can link simple "hello world" project against leptonica library successfully.

But when I try to link project against tesseract, then multiple errors occur, like following:

08:05:30 **** Build of configuration Debug for project Try_Tesseract_01 ****
make all 
Building target: Try_Tesseract_01.exe
Invoking: Cygwin C++ Linker
g++ -L/usr/local/lib -o "Try_Tesseract_01.exe"  ./src/Try_Tesseract_01.o   -llept -ltesseract
/usr/local/lib/libtesseract.a(libtesseract_api_la-baseapi.o): In function `ZN9tesseract11TessBaseAPI7DumpPGMEPKc':
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:674: undefined reference to `pixGetWidth'
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:675: undefined reference to `pixGetHeight'
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:676: undefined reference to `pixGetData'
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:678: undefined reference to `pixGetWpl'
/usr/local/lib/libtesseract.a(libtesseract_api_la-baseapi.o): In function `ZN9tesseract11CubeAPITestEP4BoxaP4PixaS1_S3_RK6FCOORDP3PixP8PAGE_RES':
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:697: undefined reference to `boxaGetCount'
/cygdrive/d/Users/Dims/Design/Cygwin/tesseract-ocr/api/baseapi.cpp:698: undefined reference to `pixaGetCount'

and so on.

Looks like tesseract library does not link to leptonica library correctly. May be object name decoration differs or something.

How to check/fix?

Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385

1 Answers1

0

See http://mhoenicka.de/system-cgi/blog/index.php?itemid=2227

"Now I tried to build tesseract proper. I downloaded the 3.01 sources. ./configure complained that the leptonica lib is present but lacks a particular function (pixCreate, to be specific). Turned out that tesseract (or is that Cygwin?) does not include /usr/local/lib in the library search path, causing the test code to fail. "

also see

http://www.sk-spell.sk.cx/compiling-leptonica-and-tesseract-ocr-with-mingwmsys

sdk
  • 51
  • 2