configure: error: leptonica library missing (when building tesseract-ocr-3.01 on MinGW)

余生颓废 提交于 2019-12-03 12:46:27

I finally managed to make it compile, after reading this and this thread. The proper steps for were:

./autogen.sh
export LIBLEPT_HEADERSDIR=/local/include
./configure --with-extra-libraries=/local/lib
make install

for leptonica 1.69, lib renamed to .libs, so, parameters are

export LIBLEPT_HEADERSDIR=<your_path>/leptonica-1.69/src
./autogen.sh
./configure --prefix= --with-extra-libraries=<your_path>/leptonica-1.69/src/.libs

and so on

Maybe this could solve the issue:

export LIBLEPT_HEADERSDIR=/usr-or-other/local/include

The FAQ addresses this issue and worked for me with tesseract 3.02.02 on Mac OSX 10.6.8.

In my case, this issue was caused by a missing compiler. Searching config.log revealed the following:

./configure:17287: g++ -o conftest -I/Usr/local/include/leptonica -L/usr/local/lib conftest.cpp -llept >&5 ./configure: line 2040: g++ command not found

Running apt-get install g++ solved the problem. There is an issue in the tesseract issue tracker about this.

In my case (for Ubuntu/Debian) I downloaded the latest leptonica version and the error was not fixed. To fix it I removed the package "leptonica-dev" with sudo apt-get remove libleptonica-dev and then tesseract found the leptonica version installed from the source code.

Hope it helps!

I am working on redhat linux 7.2 . None of the solution worked for me
I was getting following errors in config.log.
Package lept was not found in the pkg-config search path. Perhaps you should add the directory containing `lept.pc' to the PKG_CONFIG_PATH environment variable

PKG_CONFIG_PATH
configure script uses pkg-config utility to check for packages .
It was not able to find lept package ( although i had installed leptonica seperately )
By setting PKG_CONFIG_PATH pointing to the directory where lept.pc is present , i was able to resolve the issue .
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

i had a similar problem with trying to compile from source, but did not experience it with apt-get to install tesseract

sudo apt-get install tesseract-ocr

Apart from the Leptonica library, png, jpeg, tiff libraries had to passed to the configure script with CXX and CPP flags. To run configure as non-root - 1. LIBLEPT_HEADERSDIR=; export LIBLEPT_HEADERSDIR; 2. CXXFLAGS="-ltiff -lpng -ljpeg" CPPFLAGS="-ltiff -lpng -ljpeg" ./configure --prefix= --with-extra-libraries=

export LIBLEPT_HEADERSDIR=$dir/letonica168/include ./autogen.sh ./configure --prefix=$anotherdir --with-extra-libraries=/$dir/letonica168/lib make make install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!