我可以在 Cygwin 下成功编译两个项目(leptonica 和 tesseract)(使用提供的 configure+make)。
此外,我可以成功地将简单的“hello world”项目与 leptonica 库链接起来。
但是当我尝试将项目与 tesseract 链接时,会出现多个错误,如下所示:
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'
等等。
看起来 tesseract 库没有正确链接到 leptonica 库。可能是对象名称装饰不同或什么的。
如何检查/修复?