【问题标题】:Error tesseract qt错误 tesseract qt
【发布时间】:2016-01-25 08:10:03
【问题描述】:

我有一个奇怪的错误。 我想构建一个简单的例子。

.pro 文件:

... 

LIBS += ... -llept
LIBS += ... -ltesseract

main.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

【问题讨论】:

  • undefined deflate 听起来像是缺少 zlib。你有链接到-lz 吗?
  • 谢谢它解决了我的问题!

标签: c++ linux qt tesseract leptonica


【解决方案1】:

您必须将源文件 (.cpp) 添加到 .pro 文件中。

Similar problem

【讨论】:

  • 可能不会。听起来更像是路径中缺少库。
猜你喜欢
  • 2014-09-11
  • 2017-01-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多