I am trying to compile tesseract 3.05.01 on Debian9.
I have build and installed leptonica 1.74.04 from source.
The error is obviously about a missing library:
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -std=c++11 -o
tesseract tesseract-tesseractmain.o libtesseract.la -lrt -lpthread
libtool: link: g++ -g -O2 -std=c++11 -o .libs/tesseract
tesseract-tesseractmain.o ./.libs/libtesseract.so -lrt -lpthread
//usr/local/lib/liblept.so.5: error adding symbols: DSO missing from
command line
/usr/bin/ld: tesseract-tesseractmain.o: undefined reference to symbol
'lept_free'
collect2: error: ld returned 1 exit status
Makefile:598: recipe for target 'tesseract' failed
make[2]: *** [tesseract] Error 1
make[2]: Leaving directory '/opt/tesseract-3.05.01/api'
Makefile:489: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/opt/tesseract-3.05.01'
Makefile:398: recipe for target 'all' failed
make: *** [all] Error 2
root@d:/opt/tesseract-3.05.01#
I saw similiar issues reported, but all of them referred to a name conflict
on liblept.so vs. libleptonica.so.
In my case, the library seemed to be in place:
root@d:# ls -lsa /usr/local/lib/
total 25196
4 drwxrwsr-x 5 root staff 4096 Nov 15 11:21 .
4 drwxrwsr-x 10 root staff 4096 Nov 14 12:34 ..
15816 -rw-r--r-- 1 root staff 16192314 Nov 15 07:35 liblept.a
4 -rwxr-xr-x 1 root staff 969 Nov 15 07:35 liblept.la
0 lrwxrwxrwx 1 root staff 16 Nov 15 07:35 liblept.so ->
liblept.so.5.0.1
0 lrwxrwxrwx 1 root staff 16 Nov 15 07:35 liblept.so.5 ->
liblept.so.5.0.1
9356 -rwxr-xr-x 1 root staff 9578184 Nov 15 07:35 liblept.so.5.0.1
4 drwxr-sr-x 2 root staff 4096 Nov 15 07:35 pkgconfig
4 drwxrwsr-x 4 root staff 4096 Nov 14 13:45 python2.7
4 drwxrwsr-x 3 root staff 4096 Nov 14 13:45 python3.5
libtesseract.la correctly refers to this libs:
...
# Libraries that this one depends upon.
dependency_libs=' -L/usr/local/lib /usr/local/lib/liblept.la -lz -lpng
-ljpeg -ltiff -lpthread'
liblept.la:
...
# The name that we can dlopen(3).
dlname='liblept.so.5'
...
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
And the liblept.so exports the required symbol:
root@d:/usr/local/lib# nm --defined-only -g liblept.so
...
00000000001ce260 T lept_fopen
00000000001ccda0 T lept_free
...
Make and install is done as root. I have no idea how to fix this and would
be glad for any help.
A former build with the same steps in may this year went without problems.
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/0e2e9589-c68b-45af-8942-5e40cf377570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.