Build tesseract as DLL Dynamic link library

Seltix

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:

  • leptonica-X.XX.X.dll
  • tesseract.exe
  • tesseractXX.dll

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Server library could not be loaded and the dynamic link library LIBPQ.dll

From Dev

Could not be located in dynamic link library php4ts.dll

From Dev

The ordinal 3283 could not be located in the dynamic link library libmysql.dll

From Javascript

Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

From Dev

C#: A dynamic link library (DLL) initialization routine failed

From Dev

Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

From Dev

FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

From Dev

Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

From Dev

Dynamic link library in C

From Dev

Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

From Dev

Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

From Dev

The procedure entry point ... renderSynchronous@QRenderAspectPrivate@Qt3DRender ... could not be located in the dynamic link library ... *.dll

From Java

Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?

From

Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

From Dev

How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

From Dev

A dynamic link library (DLL) initialization routine failed | nw.js error connecting canvas

From Dev

Error while importing Tensorflow. A dynamic link library (DLL) initialization routine failed

From Dev

The procedure entiy point_JVM_GetClassMethod@24 could not belocated in the dynamic link library jvm.dll

From Dev

Unable to link dynamic library in macOS

From Dev

Pass function to dynamic link library

From Dev

C++ Build library and link it

From Dev

Link to a dynamic link library in a cmake project

From Dev

How to include tesseract library in node-gyp build process

From Dev

The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic link library sfml-graphics-2.dll

From Dev

Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

From Dev

Statically link google protobuf lib into a dll library

From Dev

How to link shared library *dll with CMake in Windows

From Dev

Properties of dynamic link libraries in Windows (dll)

From Dev

Can I force a dynamic library to link to a specific dynamic library dependency?

Related Related

  1. 1

    Server library could not be loaded and the dynamic link library LIBPQ.dll

  2. 2

    Could not be located in dynamic link library php4ts.dll

  3. 3

    The ordinal 3283 could not be located in the dynamic link library libmysql.dll

  4. 4

    Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

  5. 5

    C#: A dynamic link library (DLL) initialization routine failed

  6. 6

    Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

  7. 7

    FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

  8. 8

    Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

  9. 9

    Dynamic link library in C

  10. 10

    Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

  11. 11

    Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

  12. 12

    The procedure entry point ... renderSynchronous@QRenderAspectPrivate@Qt3DRender ... could not be located in the dynamic link library ... *.dll

  13. 13

    Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?

  14. 14

    Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

  15. 15

    How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

  16. 16

    A dynamic link library (DLL) initialization routine failed | nw.js error connecting canvas

  17. 17

    Error while importing Tensorflow. A dynamic link library (DLL) initialization routine failed

  18. 18

    The procedure entiy point_JVM_GetClassMethod@24 could not belocated in the dynamic link library jvm.dll

  19. 19

    Unable to link dynamic library in macOS

  20. 20

    Pass function to dynamic link library

  21. 21

    C++ Build library and link it

  22. 22

    Link to a dynamic link library in a cmake project

  23. 23

    How to include tesseract library in node-gyp build process

  24. 24

    The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic link library sfml-graphics-2.dll

  25. 25

    Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

  26. 26

    Statically link google protobuf lib into a dll library

  27. 27

    How to link shared library *dll with CMake in Windows

  28. 28

    Properties of dynamic link libraries in Windows (dll)

  29. 29

    Can I force a dynamic library to link to a specific dynamic library dependency?

HotTag

Archive