undefined reference to `tesseract::TessBaseAPI::TessBaseAPI()

1,220 views
Skip to first unread message

Liu Paulson

unread,
Nov 2, 2015, 2:35:13 AM11/2/15
to tesseract-ocr
I download  the tesseract-ocr library from the https://code.google.com/p/tesseract-ocr/downloads/list
tesseract-3.02.02-win32-lib-include-dirs.zip

I use the Qt platform to bulid the program:
Add the below code to the project.pro file:
INCLUDEPATH  += ./include/tesseract/ \
                ./include/leptonica/ \
                ./include

LIBS+= ./lib/libtesseract302.dll \
       ./lib/libtesseract302.lib

Add the below code to the project.h file:
#include <tesseract/baseapi.h>

Add the below code to the project.cpp file:
    const char* filename = "./number.jpg";
    const char* lang = "eng";

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

////////////////////////////////////////////////////////////////////////////////////////////////
But when I compile the project , the error coming like:
undefined reference to `tesseract::TessBaseAPI::TessBaseAPI()


How can I solve the problem? Anyone can tell me how to connect the library of the tesseract_ocr  in the Qt5.5 ? Thank you very much.


zdenko podobny

unread,
Nov 2, 2015, 2:39:25 AM11/2/15
to tesser...@googlegroups.com
have a look at qt-box-editor[1] (even I did not test it with for a long time, but there should be support for QT5)

Zdenko

--
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 http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/6793cbaf-3cd4-4cd6-a791-00e14524855d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Liu Paulson

unread,
Nov 2, 2015, 11:16:55 AM11/2/15
to tesseract-ocr
I will try this example tomorrow and  feedback the result to you ......

在 2015年11月2日星期一 UTC+8下午3:39:25,zdenop写道:

Liu Paulson

unread,
Nov 2, 2015, 10:03:08 PM11/2/15
to tesseract-ocr

I have download the project qt-box-editor , the .pro file is :

RESOURCES
= resources/application.qrc \

    resources/QBE-GNOME.qrc \

    resources/QBE-Faenza.qrc \

    resources/QBE-Oxygen.qrc \

    resources/QBE-Tango.qrc



LIBS += -llept -ltesseract



win32: {

    DESTDIR = ./win32

    CONFIG += release embed_manifest_exe

    TMAKE_CXXFLAGS += -DQT_NODLL

    TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti -static

    #QTPLUGIN += qsvg # image formats

     DEFINES += WINDOWS

    #QMAKE_LFLAGS.gcc += -static-libgcc # -static

    RC_FILE = resources/win.rc

    INCLUDEPATH += $$PWD/win32-external/include/

    LIBS += -lws2_32 -L$$PWD/win32-external/lib

}



unix: {

    greaterThan(QT_MAJOR_VERSION, 5) {

      message(Qt $$[QT_VERSION] was detected.)

      QT += widgets

      INCLUDEPATH += -L/opt/include/

      LIBS += -L/opt/lib

    }

}

But when I bulid the project, error coming: 

cannot find -llept
cannot find -ltesseract
ld returned 1 exit status

Which library should I download ? How can I connect the library in this project?

在 2015年11月2日星期一 UTC+8下午3:39:25,zdenop写道:
have a look at qt-box-editor[1] (even I did not test it with for a long time, but there should be support for QT5)

zdenko podobny

unread,
Nov 3, 2015, 2:49:19 AM11/3/15
to tesser...@googlegroups.com
If you want to use tesseract you need to have tesseract library. And tesseract need leptonica[1]

Error message is clear - compiler can not find these libraries - you need to adjust path in project file according location of that libraries.


Zdenko

Reply all
Reply to author
Forward
0 new messages