QT undefined reference to tesseract::TessBaseAPI::TessBaseAPI()
-
Code sample
#include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>#include <iostream>
using namespace std;
int main()
{
char *outText;tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
}
getting errorC:\Users\66820\Documents\Tess\main.cpp:14: error: undefined reference to `tesseract::TessBaseAPI::TessBaseAPI()'
Pro File TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
LIBS +=-LC:\new\lib
-ltesseract3.02.02.dll
-llept.dll
-ltesseract
-lstdc++
INCLUDEPATH+=C:\new\include\
INCLUDEPATH+=C:\new\include\leptonica
INCLUDEPATH += C:\tesseract-ocr\api
changed pro.file to
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qtSOURCES += main.cpp
LIBS +=-LC:\new\lib
-ltesseract3.02.02.dll
-lllept.dll\INCLUDEPATH+=C:\new\include
getting new errors::-1: error: cannot find -ltesseract3.02.02.dll
:-1: error: cannot find -lllept.dll -
@kapabahwuk said in QT undefined reference to tesseract::TessBaseAPI::TessBaseAPI():
LIBS +=-LC:\new\lib
-ltesseract3.02.02.dll
-lllept.dll\Use forward slashes in paths:
LIBS +=-LC:/new/lib \ -ltesseract3.02.02.dll \ -lllept.dll
For linking on Windows you need *.lib files, not *.dll files (those are needed when executing the app).
It should look like this then:LIBS += "C:/new/lib/tesseract3.02.02.lib" \ "C:/new/lib/llept.lib"
-
@kapabahwuk tesseract3.02.02.dll and llept.dll can you share? 1721849726@qq.com Thank you
-