jacklicn / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

ld undefined symbol in file tesseract.so #582

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. launch autogen.sh
2. launch ./configure
3. launch make

What is the expected output? What do you see instead?

when trying to compile running 'make', compilation stops suddenly with this 
error:

libtool: link: ranlib .libs/libtesseract.a
libtool: link: rm -fr .libs/libtesseract.lax
libtool: link: ( cd ".libs" && rm -f "libtesseract.la" && ln -s 
"../libtesseract.la" "libtesseract.la" )
g++ -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/usr/local/share/locale\" 
-I../ccutil -I../ccstruct  -I../image -I../viewer  -I../textord -I../dict  
-I../classify -I../ccmain  -I../wordrec -I../cutil 
-I/usr/local/include/leptonica  -g -O2 -MT tesseractmain.o -MD -MP -MF 
.deps/tesseractmain.Tpo -c -o tesseractmain.o `test -f 
'../api/tesseractmain.cpp' || echo './'`../api/tesseractmain.cpp
mv -f .deps/tesseractmain.Tpo .deps/tesseractmain.Po
/bin/bash ../libtool --tag=CXX    --mode=link g++  -g -O2    -o tesseract 
tesseractmain.o libtesseract.la -llept
libtool: link: g++ -g -O2 -o .libs/tesseract tesseractmain.o  
./.libs/libtesseract.so -L./ -L../ -L../api -L../ccutil -L../viewer -L../cutil 
-L../image -L../ccstruct -L../dict -L../classify -L../wordrec 
-L../neural_networks/runtime -L../textord -L../cube -L../ccmain -L/usr/sfw/lib 
/usr/sfw/lib/libstdc++.so -lgcc_s /usr/local/lib/liblept.so -lpng -ljpeg 
/usr/local/lib/libpng15.so -lz -lm /usr/local/lib/libjpeg.so -Wl,-R 
-Wl,/usr/local/lib -Wl,-R -Wl,/usr/sfw/lib
ld: warning: file /usr/local/lib/libpng15.so: linked to 
/usr/local/lib/libpng.so: attempted multiple inclusion of file
ld: warning: file /usr/local/lib/libjpeg.so: attempted multiple inclusion of 
file
ld: warning: file /usr/sfw/lib/libstdc++.so: attempted multiple inclusion of 
file
Undefined                       first referenced
 symbol                             in file
recv                                ./.libs/libtesseract.so
send                                ./.libs/libtesseract.so
__xnet_connect                      ./.libs/libtesseract.so
__xnet_socket                       ./.libs/libtesseract.so
gethostbyname                       ./.libs/libtesseract.so
sem_init                            ./.libs/libtesseract.so
sem_post                            ./.libs/libtesseract.so
sem_wait                            ./.libs/libtesseract.so
ld: fatal: Symbol referencing errors. No output written to .libs/tesseract
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `tesseract'
Current working directory /tmp/tesseract-3.01/api
*** Error code 1
The following command caused the error:
fail= failcom='exit 1'; \
for f in x $MAKEFLAGS; do \
  case $f in \
    *=* | --[!k]*);; \
    *k*) failcom='fail=yes';; \
  esac; \
done; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='ccutil viewer cutil image ccstruct dict classify wordrec 
neural_networks/runtime textord cube ccmain api . training java tessdata 
testing doc'; for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/tesseract-3.01
*** Error code 1
make: Fatal error: Command failed for target `all'

What version of the product are you using? On what operating system?

tesseract 3.0.1 with leptonica 1.6.8 under Solaris 5.10 Generic_141444-09 sun4v 
sparc SUNW,Sun-Fire-T200 Solaris 

Original issue reported on code.google.com by jolivanp...@gmail.com on 21 Nov 2011 at 5:58

GoogleCodeExporter commented 9 years ago
Solved! i added this libraries to LIBS var in Makefile:

"LIBS = -llept -lsocket -lnsl -lrt -lxnet"

and now it compiles and builds on Solaris 10 SPARC

Original comment by jolivanp...@gmail.com on 22 Nov 2011 at 9:03

GoogleCodeExporter commented 9 years ago
thanks for info building on Solaris 10 SPARC.

Original comment by zde...@gmail.com on 22 Nov 2011 at 10:37

GoogleCodeExporter commented 9 years ago

Original comment by zde...@gmail.com on 6 Mar 2012 at 8:27

GoogleCodeExporter commented 9 years ago
With tesseract-ocr-3.02.02 on Solaris 10 (Generic_147441-01 i86pc i386 i86pc)

libtool: link: ranlib .libs/libtesseract.a
libtool: link: rm -fr .libs/libtesseract.lax
libtool: link: ( cd ".libs" && rm -f "libtesseract.la" && ln -s 
"../libtesseract.la" "libtesseract.la" )
g++ -DHAVE_CONFIG_H -I. -I..  -O3 -DNDEBUG 
-DLOCALEDIR=\"/usr/local/share/locale\" -I../ccutil -I../ccstruct -I../image 
-I../viewer -I../textord -I../dict -I../classify -I../ccmain -I../wordrec 
-I../cutil   -I/usr/local/include/leptonica  -g -O2 -MT 
tesseract-tesseractmain.o -MD -MP -MF .deps/tesseract-tesseractmain.Tpo -c -o 
tesseract-tesseractmain.o `test -f '../api/tesseractmain.cpp' || echo 
'./'`../api/tesseractmain.cpp
mv -f .deps/tesseract-tesseractmain.Tpo .deps/tesseract-tesseractmain.Po
/bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O2   -o tesseract 
tesseract-tesseractmain.o libtesseract.la  -llept -lrt
libtool: link: g++ -g -O2 -o .libs/tesseract tesseract-tesseractmain.o  
./.libs/libtesseract.so -L/usr/sfw/lib /usr/sfw/lib/libstdc++.so -lgcc_s 
/usr/local/lib/liblept.so -lm -lz -lpng -ljpeg -ltiff -lrt -Wl,-R 
-Wl,/usr/local/lib -Wl,-R -Wl,/usr/sfw/lib
ld: warning: file /usr/sfw/lib/libstdc++.so: attempted multiple inclusion of 
file
Undefined                       first referenced
 symbol                             in file
recv                                ./.libs/libtesseract.so
send                                ./.libs/libtesseract.so
__xnet_connect                      ./.libs/libtesseract.so
__xnet_socket                       ./.libs/libtesseract.so
gethostbyname                       ./.libs/libtesseract.so
ld: fatal: symbol referencing errors. No output written to .libs/tesseract
collect2: ld returned 1 exit status
gmake[2]: *** [tesseract] Error 1
gmake[2]: Leaving directory `/root/TESS/tesseract-ocr/api'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/root/TESS/tesseract-ocr'
gmake: *** [all] Error 2

I tried to change "LIBS = -llept -lsocket -lnsl -lrt -lxnet" but still got the 
same issue. 

Any idea?

Original comment by arnaud.m...@gmail.com on 17 May 2013 at 1:06

GoogleCodeExporter commented 9 years ago
fixed in r895

Original comment by zde...@gmail.com on 20 Oct 2013 at 8:59

GoogleCodeExporter commented 9 years ago
Issue 915 has been merged into this issue.

Original comment by zde...@gmail.com on 20 Oct 2013 at 9:00

GoogleCodeExporter commented 9 years ago
The link to r895 is non operational and it still does not work automatically on 
SmartOS with the exact same errors as mentioned above without manually editing 
the Makefile.

Original comment by mgt...@gmail.com on 11 Oct 2014 at 10:46