Sicos1977 / TesseractOCR

A .net library to work with Google's Tesseract
167 stars 21 forks source link

Unable to load shared library 'libdl' or one of its dependencies on Xubuntu 22.04 #15

Closed AlexZeitler closed 2 years ago

AlexZeitler commented 2 years ago

I'm trying to run this sample from the README on Xubuntu 22.04:

using TesseractOCR;
using TesseractOCR.Enums;

var testImagePath = "./in/scan1.png";
using var engine = new Engine(@"./tessdata", Language.English, EngineMode.Default);
using var img = TesseractOCR.Pix.Image.LoadFromFile(testImagePath);
using var page = engine.Process(img);
Console.WriteLine("Mean confidence: {0}", page.MeanConfidence);
Console.WriteLine("Text: \r\n{0}", page.Text);

After sudo apt install libleptonica-dev and symlink-ing libleptonica-1.82.0.dll.so as described in https://github.com/Sicos1977/TesseractOCR/issues/11#issuecomment-1148579216, I got this error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory

The full log from LD_DEBUG=libs dotnet run 2>debug.log:

    157603: find library=libpthread.so.0 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libpthread.so.0
    157603: 
    157603: find library=libdl.so.2 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libdl.so.2
    157603: 
    157603: find library=libstdc++.so.6 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libstdc++.so.6
    157603: 
    157603: find library=libm.so.6 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libm.so.6
    157603: 
    157603: find library=libgcc_s.so.1 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
    157603: 
    157603: find library=libc.so.6 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libc.so.6
    157603: 
    157603: 
    157603: calling init: /lib64/ld-linux-x86-64.so.2
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libc.so.6
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libm.so.6
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libstdc++.so.6
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libdl.so.2
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
    157603: 
    157603: 
    157603: initialize program: dotnet
    157603: 
    157603: 
    157603: transferring control: dotnet
    157603: 
    157603: 
    157603: calling init: /usr/share/dotnet/host/fxr/6.0.6/libhostfxr.so
    157603: 
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libhostpolicy.so
    157603: 
    157603: find library=librt.so.1 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/librt.so.1
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/librt.so.1
    157603: 
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libcoreclr.so
    157603: 
    157603: find library=liblttng-ust.so.0 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/lib/x86_64-linux-gnu/tls/x86_64/x86_64:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/x86_64/x86_64:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu/tls/x86_64/x86_64:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/x86_64/x86_64:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/glibc-hwcaps/x86-64-v2:/lib/tls/x86_64/x86_64:/lib/tls/x86_64:/lib/tls/x86_64:/lib/tls:/lib/x86_64/x86_64:/lib/x86_64:/lib/x86_64:/lib:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib/tls/x86_64/x86_64:/usr/lib/tls/x86_64:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/x86_64/x86_64:/usr/lib/x86_64:/usr/lib/x86_64:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/tls/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64-linux-gnu/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/tls/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust.so.0
    157603:   trying file=/lib/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157603:   trying file=/lib/tls/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/tls/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/x86_64/liblttng-ust.so.0
    157603:   trying file=/lib/liblttng-ust.so.0
    157603:   trying file=/usr/lib/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157603:   trying file=/usr/lib/tls/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/tls/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/tls/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/x86_64/liblttng-ust.so.0
    157603:   trying file=/usr/lib/liblttng-ust.so.0
    157603: 
    157603: find library=liblttng-ust-tracepoint.so.0 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157603:   trying file=/lib/liblttng-ust-tracepoint.so.0
    157603:   trying file=/usr/lib/liblttng-ust-tracepoint.so.0
    157603: 
    157603: find library=liblttng-ust-tracepoint.so.0 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157603:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157603:   trying file=/lib/liblttng-ust-tracepoint.so.0
    157603:   trying file=/usr/lib/liblttng-ust-tracepoint.so.0
    157603: 
    157603: dotnet: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157603: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libcoreclr.so: error: symbol lookup error: undefined symbol: PAL_RegisterModule (fatal)
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libclrjit.so
    157603: 
    157603: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libclrjit.so: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157603: dotnet: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.Native.so
    157603: 
    157603: find library=libicuuc.so.80 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.80
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.80
    157603:   trying file=/lib/libicuuc.so.80
    157603:   trying file=/usr/lib/libicuuc.so.80
    157603: 
    157603: find library=libicuuc.so.79 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.79
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.79
    157603:   trying file=/lib/libicuuc.so.79
    157603:   trying file=/usr/lib/libicuuc.so.79
    157603: 
    157603: find library=libicuuc.so.78 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.78
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.78
    157603:   trying file=/lib/libicuuc.so.78
    157603:   trying file=/usr/lib/libicuuc.so.78
    157603: 
    157603: find library=libicuuc.so.77 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.77
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.77
    157603:   trying file=/lib/libicuuc.so.77
    157603:   trying file=/usr/lib/libicuuc.so.77
    157603: 
    157603: find library=libicuuc.so.76 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.76
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.76
    157603:   trying file=/lib/libicuuc.so.76
    157603:   trying file=/usr/lib/libicuuc.so.76
    157603: 
    157603: find library=libicuuc.so.75 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.75
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.75
    157603:   trying file=/lib/libicuuc.so.75
    157603:   trying file=/usr/lib/libicuuc.so.75
    157603: 
    157603: find library=libicuuc.so.74 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.74
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.74
    157603:   trying file=/lib/libicuuc.so.74
    157603:   trying file=/usr/lib/libicuuc.so.74
    157603: 
    157603: find library=libicuuc.so.73 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.73
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.73
    157603:   trying file=/lib/libicuuc.so.73
    157603:   trying file=/usr/lib/libicuuc.so.73
    157603: 
    157603: find library=libicuuc.so.72 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.72
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.72
    157603:   trying file=/lib/libicuuc.so.72
    157603:   trying file=/usr/lib/libicuuc.so.72
    157603: 
    157603: find library=libicuuc.so.71 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.71
    157603:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.71
    157603:   trying file=/lib/libicuuc.so.71
    157603:   trying file=/usr/lib/libicuuc.so.71
    157603: 
    157603: find library=libicuuc.so.70 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.70
    157603: 
    157603: find library=libicudata.so.70 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libicudata.so.70
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libicudata.so.70
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libicuuc.so.70
    157603: 
    157603: /lib/x86_64-linux-gnu/libicuuc.so.70: error: symbol lookup error: undefined symbol: u_strlen (fatal)
    157603: find library=libicui18n.so.70 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libicui18n.so.70
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libicui18n.so.70
    157603: 
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.Security.Cryptography.Native.OpenSsl.so
    157603: 
    157603: find library=libssl.so.3 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libssl.so.3
    157603: 
    157603: find library=libcrypto.so.3 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libcrypto.so.3
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libcrypto.so.3
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libssl.so.3
    157603: 
    157603: /lib/x86_64-linux-gnu/libssl.so.3: error: symbol lookup error: undefined symbol: SSL_state (fatal)
    157603: /lib/x86_64-linux-gnu/libssl.so.3: error: symbol lookup error: undefined symbol: ERR_put_error (fatal)
    157603: find library=libc.so [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/libc.so
    157603: find library=liblibc.so [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157603:   trying file=/lib/x86_64-linux-gnu/liblibc.so
    157603:   trying file=/usr/lib/x86_64-linux-gnu/liblibc.so
    157603:   trying file=/lib/liblibc.so
    157603:   trying file=/usr/lib/liblibc.so
    157603: 
    157603: find library=libz.so.1 [0]; searching
    157603:  search cache=/etc/ld.so.cache
    157603:   trying file=/lib/x86_64-linux-gnu/libz.so.1
    157603: 
    157603: 
    157603: calling init: /lib/x86_64-linux-gnu/libz.so.1
    157603: 
    157603: 
    157603: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.IO.Compression.Native.so
    157603: 
    157642: find library=libpthread.so.0 [0]; searching
    157642:  search path=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/glibc-hwcaps/x86-64-v2:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64:/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps      (RPATH from file /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/TeasseractOCROnLInux)
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/glibc-hwcaps/x86-64-v2/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/tls/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/x86_64/libpthread.so.0
    157642:   trying file=/home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/netcoredeps/libpthread.so.0
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libpthread.so.0
    157642: 
    157642: find library=libdl.so.2 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libdl.so.2
    157642: 
    157642: find library=libstdc++.so.6 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libstdc++.so.6
    157642: 
    157642: find library=libm.so.6 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libm.so.6
    157642: 
    157642: find library=libgcc_s.so.1 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
    157642: 
    157642: find library=libc.so.6 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libc.so.6
    157642: 
    157642: 
    157642: calling init: /lib64/ld-linux-x86-64.so.2
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libc.so.6
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libm.so.6
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libstdc++.so.6
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libdl.so.2
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
    157642: 
    157642: 
    157642: initialize program: /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/TeasseractOCROnLInux
    157642: 
    157642: 
    157642: transferring control: /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/TeasseractOCROnLInux
    157642: 
    157642: 
    157642: calling init: /usr/share/dotnet/host/fxr/6.0.6/libhostfxr.so
    157642: 
    157642: 
    157642: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libhostpolicy.so
    157642: 
    157642: find library=librt.so.1 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/librt.so.1
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/librt.so.1
    157642: 
    157642: 
    157642: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libcoreclr.so
    157642: 
    157642: find library=liblttng-ust.so.0 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/lib/x86_64-linux-gnu/tls/x86_64/x86_64:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/x86_64/x86_64:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu/tls/x86_64/x86_64:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/x86_64/x86_64:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/glibc-hwcaps/x86-64-v2:/lib/tls/x86_64/x86_64:/lib/tls/x86_64:/lib/tls/x86_64:/lib/tls:/lib/x86_64/x86_64:/lib/x86_64:/lib/x86_64:/lib:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib/tls/x86_64/x86_64:/usr/lib/tls/x86_64:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/x86_64/x86_64:/usr/lib/x86_64:/usr/lib/x86_64:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/tls/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64-linux-gnu/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/tls/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust.so.0
    157642:   trying file=/lib/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157642:   trying file=/lib/tls/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/tls/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/x86_64/liblttng-ust.so.0
    157642:   trying file=/lib/liblttng-ust.so.0
    157642:   trying file=/usr/lib/glibc-hwcaps/x86-64-v2/liblttng-ust.so.0
    157642:   trying file=/usr/lib/tls/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/tls/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/tls/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/x86_64/liblttng-ust.so.0
    157642:   trying file=/usr/lib/liblttng-ust.so.0
    157642: 
    157642: find library=liblttng-ust-tracepoint.so.0 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157642:   trying file=/lib/liblttng-ust-tracepoint.so.0
    157642:   trying file=/usr/lib/liblttng-ust-tracepoint.so.0
    157642: 
    157642: find library=liblttng-ust-tracepoint.so.0 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0
    157642:   trying file=/lib/liblttng-ust-tracepoint.so.0
    157642:   trying file=/usr/lib/liblttng-ust-tracepoint.so.0
    157642: 
    157642: /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/TeasseractOCROnLInux: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157642: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libcoreclr.so: error: symbol lookup error: undefined symbol: PAL_RegisterModule (fatal)
    157642: 
    157642: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libclrjit.so
    157642: 
    157642: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libclrjit.so: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157642: /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/bin/Debug/net6.0/TeasseractOCROnLInux: error: symbol lookup error: undefined symbol: DllMain (fatal)
    157642: 
    157642: calling init: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.Native.so
    157642: 
    157642: find library=libicuuc.so.80 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.80
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.80
    157642:   trying file=/lib/libicuuc.so.80
    157642:   trying file=/usr/lib/libicuuc.so.80
    157642: 
    157642: find library=libicuuc.so.79 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.79
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.79
    157642:   trying file=/lib/libicuuc.so.79
    157642:   trying file=/usr/lib/libicuuc.so.79
    157642: 
    157642: find library=libicuuc.so.78 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.78
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.78
    157642:   trying file=/lib/libicuuc.so.78
    157642:   trying file=/usr/lib/libicuuc.so.78
    157642: 
    157642: find library=libicuuc.so.77 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.77
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.77
    157642:   trying file=/lib/libicuuc.so.77
    157642:   trying file=/usr/lib/libicuuc.so.77
    157642: 
    157642: find library=libicuuc.so.76 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.76
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.76
    157642:   trying file=/lib/libicuuc.so.76
    157642:   trying file=/usr/lib/libicuuc.so.76
    157642: 
    157642: find library=libicuuc.so.75 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.75
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.75
    157642:   trying file=/lib/libicuuc.so.75
    157642:   trying file=/usr/lib/libicuuc.so.75
    157642: 
    157642: find library=libicuuc.so.74 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.74
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.74
    157642:   trying file=/lib/libicuuc.so.74
    157642:   trying file=/usr/lib/libicuuc.so.74
    157642: 
    157642: find library=libicuuc.so.73 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.73
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.73
    157642:   trying file=/lib/libicuuc.so.73
    157642:   trying file=/usr/lib/libicuuc.so.73
    157642: 
    157642: find library=libicuuc.so.72 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.72
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.72
    157642:   trying file=/lib/libicuuc.so.72
    157642:   trying file=/usr/lib/libicuuc.so.72
    157642: 
    157642: find library=libicuuc.so.71 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.71
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libicuuc.so.71
    157642:   trying file=/lib/libicuuc.so.71
    157642:   trying file=/usr/lib/libicuuc.so.71
    157642: 
    157642: find library=libicuuc.so.70 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libicuuc.so.70
    157642: 
    157642: find library=libicudata.so.70 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libicudata.so.70
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libicudata.so.70
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libicuuc.so.70
    157642: 
    157642: /lib/x86_64-linux-gnu/libicuuc.so.70: error: symbol lookup error: undefined symbol: u_strlen (fatal)
    157642: find library=libicui18n.so.70 [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:   trying file=/lib/x86_64-linux-gnu/libicui18n.so.70
    157642: 
    157642: 
    157642: calling init: /lib/x86_64-linux-gnu/libicui18n.so.70
    157642: 
    157642: find library=libdl.so [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libdl.so
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libdl.so
    157642:   trying file=/lib/libdl.so
    157642:   trying file=/usr/lib/libdl.so
    157642: 
    157642: find library=liblibdl.so [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblibdl.so
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblibdl.so
    157642:   trying file=/lib/liblibdl.so
    157642:   trying file=/usr/lib/liblibdl.so
    157642: 
    157642: find library=libdl [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libdl
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libdl
    157642:   trying file=/lib/libdl
    157642:   trying file=/usr/lib/libdl
    157642: 
    157642: find library=liblibdl [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblibdl
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblibdl
    157642:   trying file=/lib/liblibdl
    157642:   trying file=/usr/lib/liblibdl
    157642: 
    157642: find library=libdl.so [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libdl.so
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libdl.so
    157642:   trying file=/lib/libdl.so
    157642:   trying file=/usr/lib/libdl.so
    157642: 
    157642: find library=liblibdl.so [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblibdl.so
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblibdl.so
    157642:   trying file=/lib/liblibdl.so
    157642:   trying file=/usr/lib/liblibdl.so
    157642: 
    157642: find library=libdl [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/libdl
    157642:   trying file=/usr/lib/x86_64-linux-gnu/libdl
    157642:   trying file=/lib/libdl
    157642:   trying file=/usr/lib/libdl
    157642: 
    157642: find library=liblibdl [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/liblibdl
    157642:   trying file=/usr/lib/x86_64-linux-gnu/liblibdl
    157642:   trying file=/lib/liblibdl
    157642:   trying file=/usr/lib/liblibdl
    157642: 
Unhandled exception.     157642:    find library=Microsoft.DiaSymReader.Native.amd64.dll [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642: 
    157642: find library=Microsoft.DiaSymReader.Native.amd64.dll [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642: 
    157642: find library=Microsoft.DiaSymReader.Native.amd64.dll [0]; searching
    157642:  search cache=/etc/ld.so.cache
    157642:  search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib      (system search path)
    157642:   trying file=/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/x86_64-linux-gnu/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642:   trying file=/usr/lib/Microsoft.DiaSymReader.Native.amd64.dll
    157642: 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
   at TesseractOCR.InteropDotNet.UnixLibraryLoaderLogic.UnixGetLastError()
   at TesseractOCR.InteropDotNet.UnixLibraryLoaderLogic.LoadLibrary(String fileName)
   at TesseractOCR.InteropDotNet.LibraryLoader.InternalLoadLibrary(String baseDirectory, String platformName, String fileName)
   at TesseractOCR.InteropDotNet.LibraryLoader.CheckExecutingAssemblyDomain(String fileName, String platformName)
   at TesseractOCR.InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName)
   at InteropRuntimeImplementer.LeptonicaApiSignaturesInstance.LeptonicaApiSignaturesImplementation..ctor(LibraryLoader loader)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& 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 TesseractOCR.InteropDotNet.InteropRuntimeImplementer.CreateInstance[T]()
   at TesseractOCR.Interop.LeptonicaApi.Initialize()
   at TesseractOCR.Interop.TessApi.Initialize()
   at TesseractOCR.Interop.TessApi.get_Native()
   at TesseractOCR.Engine..ctor(String dataPath, Language language, EngineMode engineMode, IEnumerable`1 configFiles, IDictionary`2 initialOptions, Boolean setOnlyNonDebugVariables, ILogger logger)
   at Program.<Main>$(String[] args) in /home/alexzeitler/src/spike-tesseract-ocr-dotnet/TeasseractOCROnLInux/Program.cs:line 9
    157603: 
    157603: calling fini: /usr/share/dotnet/host/fxr/6.0.6/libhostfxr.so [0]
    157603: 
    157603: 
    157603: calling fini: dotnet [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libhostpolicy.so [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libcoreclr.so [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libclrjit.so [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.Native.so [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libicui18n.so.70 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libicuuc.so.70 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libstdc++.so.6 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libm.so.6 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libicudata.so.70 [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.Security.Cryptography.Native.OpenSsl.so [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libssl.so.3 [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libcrypto.so.3 [0]
    157603: 
    157603: 
    157603: calling fini: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.6/libSystem.IO.Compression.Native.so [0]
    157603: 
    157603: 
    157603: calling fini: /lib/x86_64-linux-gnu/libz.so.1 [0]
    157603: 

I also found this post on StackExchange but I don't know what's the way to go now.

AlexZeitler commented 2 years ago

I also have /usr/lib/x86_64-linux-gnu/libdl.so.2 (likely after running sudo apt install libc6-dev libgdiplus libx11-dev)

AlexZeitler commented 2 years ago

sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so fixed the error message.

Now I get Failed to find library 'libtesseract51.dll.so' for platform x64 but this should be solvable as described in https://github.com/Sicos1977/TesseractOCR/issues/11#issuecomment-1148579216.

Will keep you posted.

AlexZeitler commented 2 years ago

Got it running:

sudo add-apt-repository -y ppa:alex-p/tesseract-ocr5
sudo apt install tesseract-ocr
ln -s /usr/lib/x86_64-linux-gnu/libtesseract.so.5 bin/Debug/net6.0/x64/libtesseract51.dll.so
AlexZeitler commented 2 years ago

Created a repo which builds a Docker container and runs a OCR scan: https://github.com/AlexZeitler/tesseract-ocr-dotnet6