Hi! did you found any solution for this? On Friday, November 24, 2017 at 6:13:51 PM UTC+3 kivancg...@gmail.com wrote:
> Hello everyone, > > > I'm on Linux, using Tesseract 3.05.01, Leptonica 1.74.4. Building both > from source. I have built them with no problem. > > What I want to achieve is, statically link leptonica and tesseract to a > shared object, which uses the functions from tesseract's API. Following > this linkage, I wanted to link this shared object to an executable. > Finally, there should be an executable with a shared object and these > should not need any other shared object. > > I've successfully linked the libraries to shared object(I thought so) but > when I try to link to the executable, I see that Leptonica functions are > not linked. What am I doing wrong? > > The linking of the shared object: > > > g++ -I. -I/usr/local/include/tesseract -I/usr/local/include/leptonica > -std=gnu++11 wrap.cpp /usr/local/lib/liblept.a /usr/local/lib/libtesseract.a > -shared -o wrap.so -fPIC -Wl,-Bsymbolic > > > Linking of the executable: > > > gcc test.c -o test wrap.so > > > The error I receive: > > > wrap.so: undefined reference to `sem_init' > wrap.so: undefined reference to `pixExpandReplicate' > wrap.so: undefined reference to `pixConvertTo8' > wrap.so: undefined reference to `pixGetWpl' > ... > ... > wrap.so: undefined reference to `pixConvertTo32' > wrap.so: undefined reference to `pixaCreate' > wrap.so: undefined reference to `sem_wait' > collect2: error: ld returned 1 exit status > > > What should I do to overcome these linkage problems? > > > I've attached the wrap.cpp, wrap.h and test.c: > > <https://github.com/tesseract-ocr/tesseract/files/1500978/Code.zip> > > Code.zip > <https://github.com/tesseract-ocr/tesseract/files/1500978/Code.zip> > > Environment > > - *Tesseract Version*: 3.05.01 > - *Commit Number*: The 3.05.01 branch, no change to the source > - *Platform*: 3.10.0-327.el7.x86_64 #1 > <https://github.com/tesseract-ocr/tesseract/issues/1> SMP Thu Nov 19 > 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > > -- 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 tesseract-ocr+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/39a64b56-f71d-4a8d-9557-45a7ff9b9a9en%40googlegroups.com.