Can't run Tessarct5 MBS example

Trying to run this example after downloading Home Brew and installing tesseract. It’s erroring out when looking for the leptonica library. I don’t see any Cellar folder in the /usr/local. Where might it be installed?

dlopen(/usr/local/Cellar/leptonica/1.82.0/lib/liblept.5.dylib, 0x0002): tried: ‘/usr/local/Cellar/leptonica/1.82.0/lib/liblept.5.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/leptonica/1.82.0/lib/liblept.5.dylib’ (no such file), ‘/usr/local/Cellar/leptonica/1.82.0/lib/liblept.5.dylib’ (no such file

I tried to reinstall just in case and get
Warning: tesseract 5.5.0_1 is already installed and up-to-date.

To reinstall 5.5.0_1, run:

brew reinstall tesseract

Mac-mini:~ sharond214$ brew install leptonica

==> Downloading https://formulae.brew.sh/api/formula.jws.json

==> Downloading https://formulae.brew.sh/api/cask.jws.json

Warning: leptonica 1.85.0 is already installed and up-to-date.

To reinstall 1.85.0, run:

not sure what I’m doing wrong

Sharon

Use Find Any File from Thomas Tempelmann use search for the dylib location.

1 Like

Perfect I found the files and edited the xojo example to have the correct path but now I’m getting more errors.
dlopen(/opt/homebrew/Cellar/leptonica/1.85.0/lib/libleptonica.dylib, 0x0002): tried: ‘/opt/homebrew/Cellar/leptonica/1.85.0/lib/libleptonica.dylib’ (mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’)),

Did homebrew install the wrong version? First time using homebrew.

Thanks
Sharon

https://stackoverflow.com/questions/72970363/how-do-you-install-the-x86-64-version-of-a-brew-package-on-a-m1-mac

1 Like

Could you set the project to build as universal?

1 Like

Perfect now it runs great! Thanks

Can I use this on an ios app. If so how to install tesseract to use there?

Well, you would need a compiled version of the tesseract library for iOS as e.g. framework and then tell our plugin to load it.

Or you check out the VNRecognizeTextRequestMBS class, which runs on iOS directly without tesseract.

2 Likes

I’ll definitely check this out!