https://tesseract-ocr.github.io/tessdoc/Compiling.html#windows
Windows
main branch, 3.05 and later
Using Tesseract
!!! IMPORTANT !!! To use Tesseract in your application (to include tess or to link it into your app) see this very simple example.
Build the latest library (using Software Network client)
- Download the latest SW (Software Network
https://software-network.org/
) client fromhttps://software-network.org/client/
. - Run
sw setup
(may require administrator access) - Run
sw build org.sw.demo.google.tesseract.tesseract
.
For visual studio project using tesseract
- Setup Vcpkg the Visual C++ Package Manager.
- Run
vcpkg install tesseract:x64-windows
for 64-bit. Use –head for the master branch.
Static linking
To build a self-contained tesseract.exe
executable (without any DLLs or runtime dependencies), use Vcpkg as above with the following command:
vcpkg install tesseract:x64-windows-static
for 64-bitvcpkg install tesseract:x86-windows-static
for 32-bit
Use –head for the main branch. It may still require one DLL for the OpenMP runtime, vcomp140.dll
(which you can find in the Visual C++ Redistributable 2015).
Build training tools
Today it is possible to build a full set of tess training tools on Windows with Visual Studio. You need to have the latest VS compiler (VS2019/2022 or light VS 2019/2022 build tools distro installed.
To do this:
- Download the latest SW (Software Network
https://software-network.org/client/
) client fromhttps://software-network.org/client/
. - Checkout tesseract sources
git clone https://github.com/tesseract-ocr/tesseract tesseract && cd tesseract
. - Run
sw build
. - Binaries will be available under .sw\out\some hash dir...
Develop Tesseract
For development purposes of Tesseract itself do the next steps:
- Download and install Git, CMake and put them in PATH.
- Download the latest SW (Software Network
https://software-network.org/
) client fromhttps://software-network.org/client/
. SW is a source package distribution system. - Add SW client to PATH.
- Run
sw setup
(may require administrator access) - If you have a release archive, unpack it to
tesseract
dir.
If you’re using main branch run
git clone https://github.com/tesseract-ocr/tesseract tesseract
-
Run
cd tesseract mkdir build && cd build cmake ..
-
Build a solution (
tesseract.sln
) in your Visual Studio version. If you want to build and install from command line (e.g. Release build) you can use this command:cmake --build . --config Release --target install
If you want to install to other directory that C:\Program Files (you will need admin right for this), you need to specify install path during configuration:
cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst
For development purposes of training tools after cloning a repo from previous paragraph, run
sw build
You’ll see a solution link appeared in the root directory of Tesseract.
https://tesseract-ocr.github.io/tessdoc/Compiling.html
https://github.com/tesseract-ocr/tesseract?tab=readme-ov-file