Skip to content
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

Add NixOS Support #3

Open
KanagawaMarcos opened this issue Aug 26, 2023 · 0 comments
Open

Add NixOS Support #3

KanagawaMarcos opened this issue Aug 26, 2023 · 0 comments

Comments

@KanagawaMarcos
Copy link
Owner

KanagawaMarcos commented Aug 26, 2023

If you try to run it on linux you are going to run into issues with missing Windows libraries

[kanagawamarcos@nixos:~/repos/Ocr/Console]$ dotnet run
Unhandled exception. System.TypeInitializationException: The type initializer for '<StartupCode$Engine>.$Library' threw an exception.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Failed to find library "libleptonica-1.80.0.so" for platform x64.
   at InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName)
   at InteropRuntimeImplementer.LeptonicaApiSignaturesInstance.LeptonicaApiSignaturesImplementation..ctor(LibraryLoader loader)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at InteropDotNet.InteropRuntimeImplementer.CreateInstance[T]()
   at Tesseract.Interop.LeptonicaApi.Initialize()
   at Tesseract.Interop.TessApi.Initialize()
   at Tesseract.Interop.TessApi.get_Native()
   at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode, IEnumerable`1 configFiles, IDictionary`2 initialOptions, Boolean setOnlyNonDebugVariables)
   at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode)
   at <StartupCode$Engine>.$Library..cctor() in /home/kanagawamarcos/repos/Ocr/Engine/Library.fs:line 10
   --- End of inner exception stack trace ---
   at Engine.Ocr.get_score()
   at Program.main(String[] args) in /home/kanagawamarcos/repos/Ocr/Console/Program.fs:line 7

To solve it one need to package the following libs to nix

libleptonica-dev
libtesseract-dev
libc6-dev
libjpeg62-turbo-dev
libgdiplus

libgdiplus already has a derivation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant