-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marshaling to and from COM interface pointers isn't supported (.net core 2.1) #433
Comments
First, this is great work and a super quality library! I'm also very interested in getting this to run on Linux using .NET Core. Apparently I'm getting the same error message, but to get that far I had to do some fiddling.
to
so as a result it would accept libtesseract.so as provided by Ubuntu. Unfortunately I don't know enough to fix this or work on this issue. If there's anything I could possibly test or do to support this effort, please let me know. |
I tried to dig further into the issue. Sorry if any of this sounds dumb, but I don't fully understand what's going on and can only describe with my solid half-knowledge. So here it goes. When the required native libraries are loaded, handles for the library and all required method calls are obtained. This seems to succeed for Leptonica, however for Tesseract it fails. Here's the trace output before it crashes:
Looking at TessBaseAPIProcessPage, it maps to BaseAPIProcessPage in BaseApi.cs like so:
Now I'd suspect that pix reference to be the culprit. It is the second parameter (Cannot marshal 'parameter #2': Invalid managed/unmanaged type combination (Marshaling to and from COM interface pointers isn't supported).) Further it seems those functions are loaded in order of appearance in BaseApi.cs. That pix reference is the first occurrence of a non-trivial class (e.g. not a base type, not an enum) of those calls. Does that make sense? Could it be a bug in .NET Core on Unix? |
I have the same problem on Fedora28. |
Dear HelGeL, could you please also provide how did you obtain Trace output? I've failed to figure out what should i do in order to see the trace. |
Well, my code started to work after commenting BaseAPIProcessPage declaration. |
Thanks for info stdcall! I tried that too and now the code works on Unix. Btw I got to read the Trace output by just putting Console.WriteLines in Logger.cs. |
Yes thanks for the info I'll have a look at why that call fails and see if
we can get a linux build together.
…On Tue., 4 Sep. 2018, 03:16 HelgeL, ***@***.***> wrote:
Thanks for info stdcall! I tried that too and now the code works on Unix.
Btw I got to read the Trace output by just putting Console.WriteLines in
Logger.cs.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#433 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPzyLRHCIWPj2YBMNtB06uLVJspp_ipks5uXWQFgaJpZM4VoNQB>
.
|
Probably same problem. I'm getting this error on Ubuntu 16.04., (ASP).NET Core, Tesseract 4 |
I made nuget package for 4.0 tesseract version with fixed API. Tested on CentOS 7. |
centos7 64bit .net core2.1
exception was thrown when running
The text was updated successfully, but these errors were encountered: