If you build and install leptonica from a source, then libleptonica.so is created, but not liblept.so
However tesseract ./configure scripts requires liblept.so:
(...)
checking for leptonica... yes
checking for pixCreate in **-llept**... no
configure: error: leptonica library missing
As a workaround I just link liblept.so to created libleptonica.so, but I belive that tesseract scripts should recognize if we have liblept or libleptonica installed and use proper -l... flag for pixCreate.
Note that liblept.so is installed when you install leptonica from debian/ubuntu repository by e.g. apt-get install. Btw maybe it should be also fixed by leptonica guys to standarize library name no matter you build it by your own or install from repo (?).
Neither the stable version 3.05 nor git master tests for pixCreate.
Did you test with Tesseract 3.04 or older? Then please update to a supported version.
Previously I checked out to a tag: 3.05.00dev
Now I've just checked to a branch: 3.05 - and now it passes ./configure script, but there is some new problem with make:
/usr/bin/ld: cannot find -lleptonica_OUTPUT_NAME-NOTFOUND
collect2: error: ld returned 1 exit status
make[2]: *** [libtesseract.la] Error 1
make[2]: Opuszczenie katalogu `/home/m/OCR/download/tesseract/api'
make[1]: *** [all-recursive] Error 1
make[1]: Opuszczenie katalogu `/home/m/OCR/download/tesseract'
make: *** [all] Error 2
And for branch 3.04 without liblept.so I get:
checking for leptonica... yes
checking for l_generateCIDataForPdf in -llept... no
configure: error: leptonica library with pdf support (>= 1.71) is missing
Line 122 - configure error
What version of leptonica you use?
Did you run ./autogen.sh (in tesseract) before running ./configure ?
1) leptonica 1.74.2 builded and installed from source
2) Yes, I run autogen before configure.
As I mentioned in 1st post: leptonica builded from source does not create liblept.so, instead it creates libleptonica.so.
checking for l_generateCIDataForPdf in -llept... no
Do you have only one installation of leptonica in your system? Because current leptonica has this function.
leptonica builded from source does not create liblept.so, instead it creates libleptonica.so
I can not check it at the moment, but source code show liblept is output of compilation. How did you build leptonica?
It seems that with CMake it's libleptonica.so
Commit f52d445074d0e3863dfbe4f0b6acbf92c0f46d7d changed the library handling to use pkg-config. The branch 3.05 includes that commit. Tesseract 3.05.00 still uses the old code.
Thanks guys. To summarize:
Yes, I've got only 1 leptonica, and yes, when cmake is used then liblept.so is created instead of libleptonica.so (to be precise: cmake path/to/repo; make -j; sudo make install). For the same reason "checking for l_generateCIDataForPdf in -llept... no". But nevermind, because indeed f52d445 from 3.05 branch fixes liblept vs libleptonica. However as I mentioned some posts ago: when I use 3.05 or f52d445 I've got a problem with "make" which is connected again with leptonica.
But if you ask me, I'm satisfied with using 3.05.00 and just symlink liblept.so to libleptonica.so.
@zdenop Tagging 3.05.01 release will help.
@wosiu, the error /usr/bin/ld: cannot find -lleptonica_OUTPUT_NAME-NOTFOUND comes from an error in the Leptonica build. The string is part of lept.pc.cmake and should be replaced when lept.pc is generated. I'd try building Leptonica with configure / make instead of using cmake – maybe that fixes this problem.
Try to build both leptonoica and tesseract with the same build system (cmake / autotools)
Now I build and install leptonica like this:
./autobuild
./configure
make -j
sudo make install
and indeed liblept.so is created.
However now during tesseract (branch 3.05) "make" I get:
/usr/bin/ld: tesseract-tesseractmain.o: undefined reference to symbol 'lept_free'
/usr/local/lib/liblept.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
3.05.00 build is fine.
Does anyone have a solution to this problem without changing the debian version of the leptonica library soname (made with autotools), which is liblept.so?
@jbreiden
@DanBloomberg, I see no problem with the name of the library here. ./configure && make builds liblept.so which is fine. liblept.so also provides lept_free. @wosiu, do you compile for Linux or for Windows? Could you provide a complete build protocol?
Build leptonica with autotools, not cmake if you're using tess autotools. Otherwise use cmake+cmake build.
Most helpful comment
Now I build and install leptonica like this:
and indeed liblept.so is created.
However now during tesseract (branch 3.05) "make" I get:
3.05.00 build is fine.