#include <tesseract/baseapi.h> #include <leptonica/allheaders.h> int main() { 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/testing/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; }
/home/myuser/local/lib/libtesseract.so: undefined reference to `pixaDisplayTiledInColumns'
/home/myuser/local/lib/libtesseract.so: undefined reference to `pixReadFromMultipageTiff'
/home/myuser/local/lib/libtesseract.so: undefined reference to `pixReadMemFromMultipageTiff'
/home/myuser/local/lib/libtesseract.so: undefined reference to `pixGenerateHalftoneMask'
collect2: error: ld returned 1 exit status
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/4aa9b453-8d64-452c-93ed-226c45f84590%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.