9

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.

sashoalm
  • 75,001
  • 122
  • 434
  • 781

11 Answers11

14

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
sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 3
    my paths were `/usr/local/include` and `usr/local/lib` if that helps anyone. Also the second and third line were combined, as per your link. – jowie Mar 24 '15 at 12:54
  • This worked for me as well. After installing leptonica from source, had to configure with /usr/local/include and /usr/local/lib. – Raj Apr 23 '15 at 02:09
6

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
Jarekczek
  • 7,456
  • 3
  • 46
  • 66
  • Turns out there were some more steps needed (I now posted them in an answer), but still thanks, your advice sent me in the right direction :) – sashoalm Oct 19 '12 at 11:39
2

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

sashoalm
  • 75,001
  • 122
  • 434
  • 781
Steph
  • 21
  • 2
2

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

Tanmay Patil
  • 659
  • 1
  • 4
  • 21
1

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=

1

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.

arvidj
  • 775
  • 5
  • 25
1

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!

llazzaro
  • 3,970
  • 4
  • 33
  • 47
1

The answer is going to be slightly different for everyone, depending on the state of your system.

At a high level, the pkg-config software needs to know that leptonica is installed. It searches paths for a .pc file that has the definition for the leptonica package. That file will be in different locations for different people.

You can find it using the Linux locate utility at the command line. locate lept.pc. (If you've done some recent installing/uninstalling, you may need to refresh the locate utilities database with the command updatedb.)

Whichever directory locate finds the file in, export PKG_CONFIG_PATH as that directory (export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig for example).

Then you can continue your configure/build.

Eric Ihli
  • 1,722
  • 18
  • 30
0

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
CompChemist
  • 903
  • 2
  • 8
  • 15
-3

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