gcc链接器在cygwin下找不到任何库交叉引用

时间:2013-10-03 04:19:17

标签: c++ gcc cygwin tesseract leptonica

我可以在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库。可能是对象名称的装饰有所不同。

如何检查/修复?

1 个答案:

答案 0 :(得分:0)

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

“现在我尝试正确构建tesseract。我下载了3.01源代码./configure抱怨leptonica lib存在但缺少特定功能(pixCreate,具体而言)。原来那个tesseract(或者是Cygwin) ?)库搜索路径中不包含/ usr / local / lib,导致测试代码失败。“

另见

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