houqp / leptess

Productive and safe Rust binding for leptonica and tesseract
https://houqp.github.io/leptess/leptess/index.html
MIT License
258 stars 28 forks source link

Exe crashes because leptonica-1.82.0.dll and tesseract52.dll can not be found #49

Closed Godnoken closed 1 year ago

Godnoken commented 1 year ago

Hello there!

I have after much trouble been able to compile leptess on Windows 10 but unfortunately the program immediately crashes when run. Crash messages below.

Code execution cannot continue because leptonica-1.82.0.dll cannot be found. Try reinstalling the program.

Code execution cannot continue because tesseract52.dll cannot be found. Try reinstalling the program.

I have not seen anyone mention having this issue on any of your repos. I feel quite clueless about the next step as I feel like I have been bashing my head against a wall trying to get it to compile to begin with. I have tried both using VCPKGRS_DYNAMIC=true and linking manually as in #https://github.com/ccouzens/tesseract-sys/pull/11/commits/5a3120250fb3aab64089b2da956aed5325a4dd48 I'm using the leptonica/tesseract-x64-windows build from VCPKG, but also tried the x64-windows-static-md that refused to compile.

Any ideas of where it might be going wrong?


Also, excuse my total ignorance. Does Tesseract and Leptonica get 'bundled' with the cargo build or would I have to create my own scripts for automatic installing of the two for the end user?

ccouzens commented 1 year ago

Hi, sorry for the bad experience.

I don't immediately have the answers about Windows. Perhaps @rucoder has some insights?

Does Tesseract and Leptonica get 'bundled' with the cargo build or would I have to create my own scripts for automatic installing of the two for the end user?

Neither library is bundled. The resulting program will requires the libraries to be on the system. You might be able to distribute them with your program and add to the Windows search path to point at them.

Godnoken commented 1 year ago

Hi, sorry for the bad experience.

No worries, it's all said with a twinkle in my eye, hehe. I am very grateful that this crate exists.

I don't immediately have the answers about Windows. Perhaps @rucoder has some insights?

I fixed it by bundling all the libraries .dlls with my build, seems to work with the end users, although I've had limited test ability so far.

Thank you very much for the response.

Godnoken commented 1 year ago

For anyone who may run into similar difficulties due to a lack of experience;

Install tesseract:x64-windows-static and link manually if you want to build your .exe or .dll with Tesseract included and avoid having to depend on lots of .dll files.