Hi! I am trying to build a small utility using tesseract from a Go program, and instead of calling a subprocess and initializing the OCR engine every time I plan to run the OCR from a Go routine.
I have this small code that uses a binding to tesseract: $ cat main.go package main import ( "io/ioutil" "os" "fmt" "log" "github.com/otiai10/gosseract" ) func main() { client := gosseract.NewClient() defer client.Close() b, err := ioutil.ReadAll(os.Stdin) if err != nil { log.Fatal("Error loading image from stdin: %v", err) } if err := client.SetImagesFromBytes(b); err != nil { log.Fatal("Invalid image format from stdin: %v", err) } hocr, err := client.HOCR() if err != nil { log.Fatal("Error performing hOCR: %v", err) } fmt.Println(hocr) } When I try to compile using the version 4.1.1 of tesseract (from pkg install tesseract inside Termux) I get this errors: # github.com/otiai10/gosseract /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `omp_get_thread_num' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_serialized_parallel' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_push_num_threads' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_for_static_init_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_end_serialized_parallel' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_global_thread_num' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_fork_call' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libtesseract.so: undefined reference to `__kmpc_for_static_fini' clang-10: error: linker command failed with exit code 1 (use -v to see invocation) I don't know if this issue is in my code, the lib binding or the Termux build of tesseract. Any help to dissect this will be apreciated! Best regards, -- 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/e6139259-d7ac-4571-b8d7-8d6b2879ee9an%40googlegroups.com.