I'm using this .NET wrapper https://github.com/charlesw/tesseract and I wanted to update the included tesseract and leptonica DLLs but after a long google search I was not able to generate them from the original tesseract and leptonica github repositories.
I already ask on the charlesw repository but did not get any reply (https://github.com/charlesw/tesseract/issues/486).
Any help on how to build the DLLs is much appreciated.
Thanks!
https://github.com/tesseract-ocr/tesseract https://github.com/danbloomberg/leptonica
Answer : (thank you user898678 for the link) Using bucket401 blog post tutorial I extracted the required part to generate:
and created this buildTesseractLeptonica.bat :
mkdir buildTesseractLeptonica
cd buildTesseractLeptonica
mkdir bin
set INSTALL_DIR=%cd%
set PATH=%PATH%;%INSTALL_DIR%\bin
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" x64
set INCLUDE=%INCLUDE%;%INSTALL_DIR%\include
set LIBPATH=%LIBPATH%;%INSTALL_DIR%\lib
set TESSDATA_PREFIX=%INSTALL_DIR%\share\tesseract\tessdata
git clone --depth 1 https://github.com/DanBloomberg/leptonica.git
cd leptonica
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DBUILD_PROG=OFF -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON
cmake --build build --config Release --target install
cd ..
git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git
cd tesseract
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DLeptonica_DIR=%INSTALL_DIR%\lib\cmake -DBUILD_TRAINING_TOOLS=OFF -DSW_BUILD=OFF -DOPENMP_BUILD=OFF -DBUILD_SHARED_LIBS=ON
cmake --build build --config Release --target install
cd ..
bucket401 blog post link: https://bucket401.blogspot.com/2021/03/building-tesserocr-on-ms-windows-64bit.html
There are several tutorials you can follow:
https://bucket401.blogspot.com/2021/03/building-tesserocr-on-ms-windows-64bit.html http://spell.linux.sk/building-minimalistic-tesseract https://github.com/tesseract-ocr/tessdoc/blob/main/Compiling.md#windows