Error looking up function 'TessPDFRendererCreateTextonly'

Asked by Pedro García on 2018-12-10

Hi, I need to capture text (using Tesseract OCR) from a region of the terminal window of my Oracle VM Vbox.

 I'm using Eclipse in Ubuntu 18.04 and have:
 - installed opencv (with cmake -D BUILD_SHARED_LIBS=ON .. & make -j4) and tesseract (with sudo apt-get install tesseract),
 - linked to /usr/lib.
 - set LD_LIBRARY_PATH environment variable to the path where is.
 - Included the latest sikulixapi.jar in my Eclipse Project (and every sikulix command is working except the OCR part)

To solve the error I've tried (as recommended in ): "uninstalled tesseract version 4 and installed the version 3.04 from the Ubuntu repositories. I changed the tess4j version in my pom.xml to 3.0.0",
 but still get the same error.

Here is the line of my script that produces the error (second line):
region = new Region(273, 129, 73, 250);
String sikuliText = region.text();

Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'TessPDFRendererCreateTextonly': /usr/lib/ undefined symbol: TessPDFRendererCreateTextonly
 at com.sun.jna.Function.<init>(
 at com.sun.jna.NativeLibrary.getFunction(
 at com.sun.jna.NativeLibrary.getFunction(
 at com.sun.jna.NativeLibrary.getFunction(
 at com.sun.jna.Native.register(
 at com.sun.jna.Native.register(
 at com.sun.jna.Native.register(
 at net.sourceforge.tess4j.TessAPI1.<clinit>(
 at org.sikuli.script.TextRecognizer.start(
 at org.sikuli.script.TextRecognizer.doOCR(
 at org.sikuli.script.TextRecognizer.doOCR(
 at org.sikuli.script.Region.text(
 at TMSconOCR.getTextByOCR(
 at TMSconOCR.main(

Am I missing something?

Thanks a lot,


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best RaiMan (raimund-hocke) said : #1

If it is SikuliX 1.1.4 you should follow the steps: (except the Java 11 hint: Java 11 is available now)

If not, the I recommend to switch to 1.1.4, which already includes the Tess4J classes.

I've followed the instructions and it´s working perfectly!!
Thank you very much.