Compiling / merging tesseract into one binary

Is it possible to compile tesseract into a single binary?

I use the following to compile the program, but how can the tesseract shared libraries be compiled into one binary, so the program is 100% portable and you don't need to install tesseract on the current system?

No need to compile leptonica to binary

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

      

+3


source to share


4 answers


To do this, you need to use a static library, on Unix systems they usually end with the extension .a and the shared library ends with .so



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

+3


source


This link is below



will help you more. Are you going to build from scratch or uselibraries that are already compiled for you for your desired OS.

0


source


Use the -static

for argument to g++

compile a static binary.

0


source


Try pyInstaller , it supports Windows, Linux and OSX. Below is an example command - create a single file executable.

pyinstaller -F /path/to/myscript.py

      

It can be installed pip install pyinstaller

or use MacPorts or Homebrew to install on OSX.

0


source







All Articles