我有一个奇怪的错误。我想建立一个简单的例子。
。轮廓:
...
LIBS += ... -llept
LIBS += ... -ltesseract
主.cpp:
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("/usr/src/tesseract-3.02/phototest.tif");
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);
return 0;
错误:
.../liblept.a(zlibmem.o): undefined reference to symbol 'deflate' error added symbols: DSO missing from command line collect2: error: Ld returned 1 exit status