There are many ways to get tesseract source code. You can get it directly from repo, or you can download a compressed package. However, there are often strange problems when compiling. Here is how to simply configure and compile the source code.
Reference original: How to Build tesseract OCR Library on Windows
Compiling tesseract
Download
Installation
During installation, tick tesseract development files:
Compile
Locate the vs2008 to the project directory in the installation directory:
Find all compilation-related libraries:
Open Visual Studio 2008 (no can go to official website to download Express version), import the project compile. Finally, debug and release two versions of DLLs are generated:libtesseract302d.dll ,libtesseract302.dll
Note this passage in the Readme:
Dependencies and licenses========================= Leptonica is required. (www.leptonica.com). Tesseract no longer compileswithout Leptonica.libtiff is no longer required as a direct dependency.
Tesseract relies on the Leptonica library, so look at how Leptonica is compiled.
Compiling Leptonica
Leptonica is an image processing library written in C that supports JPEG, PNG, Tiff,gif.
Download
Source:leptonica-1.68.tar.gz
VS Engineering:vs2008-1.68.zip
Related header files and libraries:leptonica-1.68-win32-lib-include-dirs.zip
Compile
Unzip the three packets and build the environment according to the following structure:
Buildfolder include leptonica-1.68 lib\
buildfolder\leptonica-1.68 contents:
config\ Not used for Windows buildsprog\ regression tests, examples, utilitiessrc\ Source files for libleptvs2008\ Visual Studio 2008 specific files DLL Debug\ liblept dll Debug build output DLL Release\ liblept dll release build output lib debug\ liblept lib debug build output LIB Release\ liblept LIB Release build output prog_projects\ Projects for prog programs ioformats_reg\ Sample project for prog\ioformats_reg.exe DLL Debug\ DLL Debug build output for sample project dll release\ DLL Release build output for sample project LIB Debug\ LIB Debug build output for sample project LIB Release\ lib release build output for sample project ioformats_ reg.vcproj the ioformats_reg project file leptonica.sln the leptonica solution file leptonica.vcproj the leptonica project file
Open Visual Studio 2008, import the project compilation. Finally, debug and release two versions of DLLs are generated:liblept168d.dll,liblept168.dll
Reference
Leptonica
Leptonica & Visual Studio 2008
Tesseract-ocr
How to compile Tesseract OCR on Windows