【发布时间】:2018-04-26 11:37:02
【问题描述】:
我正在研究 tesseract 引擎。
使用 red hat linux 构建 leptonica 和 tesseract 。在运行 tesseract 时出现以下错误。
[tesseract-ocr]$ tesseract address.png out1
Error in pixReadMemTiff: function not present
Error in pixReadMem: tiff: no pix returned
Error in pixaGenerateFontFromString: pix not made
Error in bmfCreate: font pixa not made
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
Error during processing.
在网上搜索时,我发现这是 leptonica build 的问题。并且它不是用 ltiff 正确构建的。事实上,在 ./configure command 生成的 config.log 中。我可以看到以下
configure:12538: checking for TIFFOpen in -ltiff
configure:12564: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/lib64 conftest.c -ltiff -lm
>&5
/bin/ld: cannot find -ltiff
但是我看到系统中存在 libtiff
[ec2-user@ip-172-31-35-131 lib]$ ldconfig -p | grep libtif
libtiffxx.so.5 (libc6,x86-64) => /lib64/libtiffxx.so.5
libtiff.so.5 (libc6,x86-64) => /lib64/libtiff.so.5
我尝试指向 /lib64 路径,根据 leptonica 网站 [http://www.leptonica.com/source/README.html][1]
最后,如果您发现已安装的程序无法链接
在运行时到已安装的库,它位于 /usr/local/lib 中,
尝试以这种方式运行配置:
LDFLAGS="-Wl,-rpath -Wl,/usr/local/lib" ./configure
这会导致编译器将这些选项传递给链接器。
将 LDFLAGS 更改为指向 /lib64 也不起作用 LDFLAGS="-Wl,-rpath -Wl,/lib64" ./configure
有什么建议吗?
【问题讨论】: