2

I want to use the tesseract with qt 5 + mingw. I downloaded vc++ libs fir from here

in my application i did:

#include "tesseract/baseapi.h"


...


tesseract::TessBaseAPI *OCRbase =  new tesseract::TessBaseAPI();

if (!OCRbase->Init(NULL,"eng",tesseract::OEM_DEFAULT))
{
    qDebug() << "tesseract init error";
    return;
}

but this code gives me such errors:

testOCR/dialog.cpp:57: undefined reference to `tesseract::TessBaseAPI::TessBaseAPI()'
debug/dialog.o: In function `ZN9tesseract11TessBaseAPI4InitEPKcS2_NS_13OcrEngineModeE':
testOCR/tesseract-3.02.02-win32-lib-include-dirs/include/tesseract/baseapi.h:208:   undefined reference to `tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool)'
collect2.exe: error: ld returned 1 exit status

My .pro file is look like this:

INCLUDEPATH += $$PWD\tesseract-3.02.02-win32-lib-include-dirs\include
LIBS += -L$$PWD\tesseract-3.02.02-win32-lib-include-dirs\lib -llibtesseract302-static-debug
LIBS += -L$$PWD\leptonica\lib -lliblept

SOURCES += main.cpp\
        dialog.cpp

HEADERS  += dialog.h

FORMS    += dialog.ui

I spent a lot of time trying to link this, is there something im doing wrong?

László Papp
  • 51,870
  • 39
  • 111
  • 135
SirLanceloaaat
  • 213
  • 9
  • 18

1 Answers1

0

I did manage to compile tesseract with mingw myself but after i tried to link it with my test application i got a lot of:

tesseract-ocr\ccutil\tprintf.cpp:56: ошибка: undefined reference to `_Unwind_Resume'

and

pageiterator.cpp:-1: ошибка: undefined reference to `__gxx_personality_v0'

errors. What does that means? in my pro file this time i did add

LIBS    += -L$$PWD\lib -llept -ltesseract -ltiff -lwebp -lgif -lpng -ljpeg -lzlib125-static-mtdll-debug
LIBS    += lws2_32
SirLanceloaaat
  • 213
  • 9
  • 18