Closed rootn3rd closed 2 years ago
Switched to using Windows container for now.
I tested this with wsl ubuntu 20.4, it works. Only the /usr/lib/x86_64-linux-gnu/libtesseract.so.4.0.0 is /usr/lib/x86_64-linux-gnu/libtesseract.so.4.0.1 now. With dotnet 6.
I'm trying to build a docker image for a console application that runs tesseract library (.NET).
Below is the content of my
Dockerfile
However, I'm seeing the below exception whenever I run the container
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: dlsym: /app/x64/libtesseract41.so: undefined symbol: TessBaseAPIGetAltoText at InteropDotNet.UnixLibraryLoaderLogic.GetProcAddress(IntPtr libraryHandle, String functionName) at InteropDotNet.LibraryLoader.GetProcAddress(IntPtr dllHandle, String name) at InteropRuntimeImplementer.TessApiSignaturesInstance.TessApiSignaturesImplementation..ctor(LibraryLoader loader) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) 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 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at InteropDotNet.InteropRuntimeImplementer.CreateInstance[T]() 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 PdfConverter.Program.ExtractText(MemoryStream stream) in D:\StudioWorks\Gothiadigital\OcrDemo\PdfConverter\Program.cs:line 67 at PdfConverter.Program.Main(String[] args) in D:\StudioWorks\Gothiadigital\OcrDemo\PdfConverter\Program.cs:line 24
Any leads would be very helpful.
Thanks