Sunday, April 9, 2017

Compile/bundle tesseract into one binary

Leave a Comment

Is it possible to compile tesseract into one binary?

I use the following to compile a program, but how is it possible to compile tesseract shared libraries into one binary so the program is 100% portable and you dont need tesseract to be installed on the current system?

Its not necessary to compile leptonica into the binary

g++ -std=c++11 txtocr.cpp -o txtocr -llept -ltesseract 

3 Answers

Answers 1

For that you need to use a Static Library, on unix systems they usually ends with the .a extension, and a Shared Library ends with .so

If you only have the .so (or .dylib on mac, .dll on windows) library of the tesseract, then you cannot compile it as a single binary.

Answers 2

This link below

will help you more. Whether you are going to compile from scratch or uselibraries which are already compiled for you for the desired OS.

Answers 3

Use the -static argument to g++ to compile a static binary.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment