2016-01-25 1 views
0

J'ai une erreur étrange. Je veux construire un exemple simple.Erreur tesseract qt

fichier .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; 

erreur:

.../liblept.a(zlibmem.o): undefined reference to symbol 'deflate' error adding symbols: DSO missing from command line collect2: error: Ld returned 1 exit status

+1

non définie deflate' sonne comme manquant zlib. Est-ce que vous liez dans '-lz'? –

+0

Thx c'est résolu mon problème !! –

Répondre

-1

Vous devez ajouter les fichiers source (.cpp) au .pro fichier.

Similar problem

+1

Probablement pas. Cela ressemble plus à une bibliothèque manquante dans le chemin. –