Unhandled exception. System.DllNotFoundException: Unable to load shared library 'Kernel32.dll' or one of its dependencies

Hi all,

I am trying to read the text from image but when i use the below code it is throwing error message.-

Unhandled exception. System.DllNotFoundException: Unable to load shared library ‘Kernel32.dll’ or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libKernel32.dll, 1): image not found
at Patagames.Ocr.Tesseract.LoadLibraryA(String path)
at Patagames.Ocr.OcrApi…ctor()
at Patagames.Ocr.OcrApi.Create()
at ReadDatainmage.ConvertImageToText() in /Volumes/Macintosh HD - Data/Csharpcode/ReadImage.cs:line 17
at ReadDatainmage.Main(String[] args) in /Volumes/Macintosh HD - Data/Csharpcode/ReadImage.cs:line 48

Code is:

public void ConvertImageToText()
{
using (var api = OcrApi.Create())
{
api.Init(Languages.English);
string plainText = api.GetTextFromImage(@"/Users/prkotagi/Desktop/Test.png");
Console.WriteLine(plainText);
Console.Read();
}
}
static void Main(String[] args){
ReadDatainmage obj = new ReadDatainmage();
obj.ConvertImageToText();
}

Are you using Tesseract or the Ocr.Space OCR API?