Error LNK2019 unresolved external symbol Tesseract OCR C ++ Using VS 2015

Has anyone had Tesseract configured the C ++ source code? It has 32 stars, but I'm stuck to even run it like this

While I try to install the source code Tesseractin my visual studio, it gives errors in obj files, how can I edit these files, and this makes no sense to me. If I do not, then what I need to do to successfully run it in my environment (I have the same specifications that github requires )

1.Error LNK2019 unresolved external symbol _l_dnaDiffAdjValues ​​referenced by the _ptraConcatenatePdfToData pdfio2.obj function

2.Error LNK2019 unresolved external symbol _l_dnaJoin referenced by the _recogAppend recogbasic.obj function

3.Error LNK1120 2 unresolved external tesseract.exe

I create it with the following settings:

1. Loaded from Link .

2. Loaded with Tesseract and leptonica .

3.It contains build_tesseract.bat to create the latest version of tesseract.

4. I chose tesseract as the project start

here is my main .cpp file

#include "baseapi.h";
#include "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;
}
+4
source share
1 answer

The error indicates that the file cannot be started x64/debug/zlib.lib. This is normal because the library file is .libnot an executable file.

, , . , main.cpp Startup Project.

Tesseract, Leptonica VS2015_Tesseract-master\leptonica Tesseract VS2015_Tesseract-master\tesseract_3.04. , VS2015_Tesseract VS2015_Tesseract-master.

VS2015_Tesseract-master\tesseract.sln Tesseract. build_tesseract.bat.

Tesseract build - tesseract.exe. main() main(int argc, char **argv) VS2015_Tesseract-master\tesseract_3.04\api\tesseractmain.cpp. .

+2

Source: https://habr.com/ru/post/1657648/


All Articles