Failing to build leptonica for ARM

So I wanted to start working on application for my android. The application includes tesseract-ocr. I have both tesseract and leptonica working for my windows computer. I have built them both with .\vcpkg install tesseract:x86-windows; however, when I try installing tesseract:arm-windows, I get an error saying the build failed.

Relevant logs:

   Creating library src\leptonica-1.76.0d.lib and object src\leptonica-1.76.0d.exp
leptwin.c.obj : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function pixGetWindowsHBITMAP
leptwin.c.obj : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function "struct HBITMAP__ * __cdecl DSCreateDIBSection(int,int,int,struct PixColormap *)" (?DSCreateDIBSection@@YAPAUHBITMAP__@@HHHPAUPixColormap@@@Z)
leptwin.c.obj : error LNK2019: unresolved external symbol __imp_GetObjectA referenced in function pixGetWindowsHBITMAP
bin\leptonica-1.76.0d.dll : fatal error LNK1120: 3 unresolved externals
ninja: build stopped: subcommand failed.


If anyone could help me figure out what is wrong or even better, how to fix it, I would be extremely grateful. Thank you!
Last edited on
I'm confused.

Is this a WINDOWS library you're attempting to use in Android?

CreateDIBSection, DeleteObject and GetObjectA are Windows API functions. I would expect no Android counterpart.

Am I way off here?
I understood that Tesseract could be built for different platforms but I may be wrong.

This is their instructions to build for windows: https://github.com/tesseract-ocr/tesseract/wiki/Compiling#windows

I am not sure where I would check if it is only for Windows.
I am also new to using vcpkg so if there is a way to build it for different platforms, will the command be different?
Is there a particular website you're following steps from? I doubt many of us know what this particular library is. (Note: I have no knowledge in cross-compiling for Android, or whatever it is you're doing, so please don't expect much from me, I'm just throwing out some ideas.)

Edit:
https://github.com/tesseract-ocr/tesseract/wiki/Compiling#windows
Where in that link does it mention compiling for ARM?

I guess what I'm asking is, where did you get the idea to run
tesseract:arm-windows
from?

Edit 2: Again, I don't know much about this, but if you're trying to develop for Android, then following a Windows guide doesn't sound very helpful.

Perhaps this SO post might shed more light?
https://stackoverflow.com/questions/7710123/how-can-i-use-tesseract-in-android
https://www.youtube.com/watch?v=WGvAhUrqIeY "Intergarde [Integrate] Tesseract OCR into android studio"
Last edited on
Well arm-windows is the triplet for an ARM processor. The link doesn't mention for ARM but I assumed, (probably incorrectly), that the process would be similar if not the same for building for ARM.
It appears there is a specific fork of Tesseract for Android

https://coderwall.com/p/eurvaq/tesseract-with-andoird-and-gradle

Might be a start.
Topic archived. No new replies allowed.