Search code examples
visual-c++visual-studio-2013tesseractunhandled-exception

Unhandled exception when running Tesseract OCR


I am trying to use tesseract for the very first time and i get the following error when i compile:

Unhandled exception at 0x76F88F05 (ntdll.dll) in lpr.exe: 0xC0150002: 
Windows was not able to process the application binding information. 
Please refer to your System Event Log for further information.

Can anyone help me?

Here's the code :

char *outText;

tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
// Initialize tesseract-ocr with English, without specifying tessdata path
if (api->Init(NULL, "eng")) {
    fprintf(stderr, "Could not initialize tesseract.\n");
    exit(1);
}

// Open input image with leptonica library
Pix *image = pixRead("B:\Projects\Visual 2013\lpr\lpr\placuta.jpeg");
api->SetImage(image);
// Get OCR result
outText = api->GetUTF8Text();
printf("OCR output:\n%s", outText);

// Destroy used object and release memory
api->End();
delete[] outText;
pixDestroy(&image);

Eventlog message:

Activation context generation failed for "B:\Projects\Visual 2013\lpr\lpr\libtesseract302d.dll".

Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e1‌​8e3b",type="win32",version="9.0.21022.8" could not be found.

Please use sxstrace.exe for detailed diagnosis.


Solution

  • Thanks Colin Robertson

    this did it for me : vorba.ch/2014/tesseract-3.03-vs2013.html –
    After you follow the steps include your lib files downloaded from tesseract google, into yout project.