问题
When running configure it fails with
checking for leptonica... yes
checking for pixCreate in -llept... no
configure: error: leptonica library missing
But I have leptonica 1.69 built (downloaded source and ran ./configure && make install
)
Edit
I think configure: error: leptonica library missing
is a bit misleading, please note that it first says checking for leptonica... yes
, and then fails on checking for pixCreate in -llept... no
. So maybe the problem is not that the library is missing, but something else.
回答1:
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
回答2:
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
回答3:
Maybe this could solve the issue:
export LIBLEPT_HEADERSDIR=/usr-or-other/local/include
回答4:
The FAQ addresses this issue and worked for me with tesseract 3.02.02 on Mac OSX 10.6.8.
回答5:
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.
回答6:
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!
回答7:
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
回答8:
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
回答9:
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=
回答10:
export LIBLEPT_HEADERSDIR=$dir/letonica168/include
./autogen.sh
./configure --prefix=$anotherdir --with-extra-libraries=/$dir/letonica168/lib
make
make install
来源:https://stackoverflow.com/questions/12971253/configure-error-leptonica-library-missing-when-building-tesseract-ocr-3-01-on