Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt and Tesseract Linkage

Qt and Tesseract Linkage

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
install
53 Posts 5 Posters 8.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OlegD
    wrote on 14 Jun 2022, 13:05 last edited by OlegD
    #36

    Now I need to build it according to my librariries...
    How can i check what do I actually have?

    Msys2
    Mingw+Msys
    Mingw-w64

    Looking for command as below, to find what do I actually have
    C:\Qt\Tools\mingw900_64>gcc -dumpversion
    11.2.0

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Jun 2022, 19:00 last edited by
      #37

      The Qt installer provides MinGW directly. It has nothing to do with MSys.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OlegD
        wrote on 14 Jun 2022, 19:14 last edited by
        #38

        So my next step must be here
        Mingw-w64

        Mingw-w64 allows building 32- or 64-bit executables for Windows. It can be used for native compilations on Windows, but also for cross compilations on Linux (which are easier and faster than native compilations). Most large Linux distributions already contain packages with the tools need for a cross build. Before building Tesseract, it is necessary to build some prerequisites.

        For Debian and similar distributions (e. g. Ubuntu), the cross tools can be installed like that:

        Development environment targeting 32- and 64-bit Windows (required)

        apt-get install mingw-w64

        Development tools for 32- and 64-bit Windows (optional)

        apt-get install mingw-w64-tools

        These prerequisites will be needed:

        libpng, libtiff, zlib (binaries for Mingw-w64 available as part of the GTK+ bundles)
        libicu
        liblcms2
        openjpeg
        leptonica
        

        what should i exactly do?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Jun 2022, 19:23 last edited by
          #39

          Why are you following the cross-compilation instructions from Linux to Windows ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • O Offline
            O Offline
            OlegD
            wrote on 14 Jun 2022, 19:52 last edited by
            #40

            Is there the similar command line in MinGW that supplied by QT?
            mingw.png

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 14 Jun 2022, 19:55 last edited by
              #41

              If memory serves well, you should have some shortcuts in the start menu that starts a command line instance that is ready to use with MinGW.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • O Offline
                O Offline
                OlegD
                wrote on 17 Jun 2022, 17:20 last edited by
                #42

                Oh, It seems I'm step behind to finish this insane journey..
                2022-06-18 00_19_38-tesseract.png
                How can I build it with QT now?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 17 Jun 2022, 17:26 last edited by
                  #43

                  As usual, point INCLUDEPATH to that folder, then LIBS to the one containing the library files and link against these libraries.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    OlegD
                    wrote on 18 Jun 2022, 17:07 last edited by
                    #44

                    Failed

                    D:\PROG\May\Tesseract\main.cpp:1: error: tesseract/baseapi.h: No such file or directory
                    D:\PROG\May\Tesseract\main.cpp:1:10: fatal error: tesseract/baseapi.h: No such file or directory
                    1 | #include <tesseract/baseapi.h>
                    | ^~~~~~~~~~~~~~~~~~~~~

                    2022-06-19 00_06_14-Tesseract.pro @ Tesseract - Qt Creator.png

                    J 1 Reply Last reply 18 Jun 2022, 17:48
                    0
                    • O Offline
                      O Offline
                      OlegD
                      wrote on 18 Jun 2022, 17:24 last edited by
                      #45

                      Here is my pro file
                      Any thoughts how can I amend this to make it work?

                      QT += core
                      QT -= gui

                      CONFIG += c++11

                      TARGET = openCV
                      CONFIG += console
                      CONFIG -= app_bundle

                      TEMPLATE = app
                      INCLUDEPATH += C:\opencv\release\install\include

                      LIBS += C:\opencv\release\bin\libopencv_core455.dll
                      LIBS += C:\opencv\release\bin\libopencv_highgui455.dll
                      LIBS += C:\opencv\release\bin\libopencv_imgcodecs455.dll
                      LIBS += C:\opencv\release\bin\libopencv_imgproc455.dll
                      LIBS += C:\opencv\release\bin\libopencv_calib3d455.dll
                      LIBS += C:\opencv\release\bin\libopencv_features2d455.dll
                      LIBS += C:\opencv\release\bin\libopencv_video455.dll
                      LIBS += C:\opencv\release\bin\libopencv_videoio455.dll

                      LIBS += -LC:\Qt\opencv_cv2\OPENCV1\build-qt\lib
                      -lopencv_calib3d249d
                      -lopencv_contrib249d
                      -lopencv_core249d
                      -lopencv_features2d249d
                      -lopencv_flann249d
                      -lopencv_gpu249d
                      -lopencv_highgui249d
                      -lopencv_imgproc249d
                      -lopencv_legacy249d
                      -lopencv_ml249d
                      -lopencv_nonfree249d
                      -lopencv_objdetect249d
                      -lopencv_ocl249d
                      -lopencv_photo249d
                      -lopencv_stitching249d
                      -lopencv_superres249d
                      -lopencv_ts249d
                      -lopencv_video249d
                      -lopencv_videostab249d

                      INCLUDEPATH+=D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract
                      LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract

                      INCLUDEPATH+=D:\MinGW\msys\1.0\src\leptonica-1.68\src
                      LIBS +=-D:\MinGW\msys\1.0\src\leptonica-1.68\src

                      SOURCES += main.cpp

                      DEFINES += QT_DEPRECATED_WARNINGS

                      1 Reply Last reply
                      0
                      • O OlegD
                        18 Jun 2022, 17:07

                        Failed

                        D:\PROG\May\Tesseract\main.cpp:1: error: tesseract/baseapi.h: No such file or directory
                        D:\PROG\May\Tesseract\main.cpp:1:10: fatal error: tesseract/baseapi.h: No such file or directory
                        1 | #include <tesseract/baseapi.h>
                        | ^~~~~~~~~~~~~~~~~~~~~

                        2022-06-19 00_06_14-Tesseract.pro @ Tesseract - Qt Creator.png

                        J Offline
                        J Offline
                        JonB
                        wrote on 18 Jun 2022, 17:48 last edited by
                        #46

                        @OlegD said in Qt and Tesseract Linkage:

                        #include <tesseract/baseapi.h>

                        That is what it it is trying to #include. So what do you think you need to add to INCLUDEPATH? Because what you have in your screenshot for that is wrong.

                        1 Reply Last reply
                        0
                        • O Offline
                          O Offline
                          OlegD
                          wrote on 18 Jun 2022, 17:56 last edited by
                          #47

                          I dont know, thats, why I'm asking

                          J 1 Reply Last reply 18 Jun 2022, 18:01
                          0
                          • O OlegD
                            18 Jun 2022, 17:56

                            I dont know, thats, why I'm asking

                            J Offline
                            J Offline
                            JonB
                            wrote on 18 Jun 2022, 18:01 last edited by
                            #48

                            @OlegD
                            A path of tesseract/baseapi.h cannot be found relative to D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract, can it? That would have tesseract\tesseract in the middle of it. If you want to find tesseract/baseapi.h you need to start looking from D:\MinGW\msys\1.0\src\tesseract-ocr\include.

                            This is not a Qt issue, just plain C++.

                            1 Reply Last reply
                            0
                            • O Offline
                              O Offline
                              OlegD
                              wrote on 18 Jun 2022, 18:33 last edited by
                              #49

                              Path seem to be ok, I think problem with msys and QT...
                              is there possibility to make them work together?

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 18 Jun 2022, 19:43 last edited by
                                #50

                                Did you fix the path as suggested by @JonB ?

                                As a side note, use forward slash for all your paths in your .pro file.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • O Offline
                                  O Offline
                                  OlegD
                                  wrote on 18 Jun 2022, 21:43 last edited by
                                  #51

                                  Same error

                                  INCLUDEPATH +=D:\MinGW\msys\1.0\src\tesseract-ocr\include
                                  LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include

                                  J S 2 Replies Last reply 19 Jun 2022, 06:55
                                  0
                                  • O OlegD
                                    18 Jun 2022, 21:43

                                    Same error

                                    INCLUDEPATH +=D:\MinGW\msys\1.0\src\tesseract-ocr\include
                                    LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include

                                    J Offline
                                    J Offline
                                    JonB
                                    wrote on 19 Jun 2022, 06:55 last edited by JonB
                                    #52

                                    @OlegD
                                    If you have D:\MinGW\msys\1.0\src\tesseract-ocr\include in your INCLUDEPATH, your code has #include <tesseract/baseapi.h> and the file baseapi.h exists in D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract then I do not see why you would get fatal error: tesseract/baseapi.h: No such file or directory.

                                    • Is that indeed the error message you still see?
                                    • Please show the compiler line being executed when it compiles your main.cpp.
                                    • Depending on compiler, it might be possible that it is an issue with where #include <...> is looking. Try changing the line in your code to read #include "tesseract/baseapi.h". Does that make any difference?
                                    1 Reply Last reply
                                    0
                                    • O OlegD
                                      18 Jun 2022, 21:43

                                      Same error

                                      INCLUDEPATH +=D:\MinGW\msys\1.0\src\tesseract-ocr\include
                                      LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include

                                      S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 19 Jun 2022, 13:15 last edited by
                                      #53

                                      @OlegD said in Qt and Tesseract Linkage:

                                      Same error

                                      INCLUDEPATH +=D:\MinGW\msys\1.0\src\tesseract-ocr\include
                                      LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include

                                      Remove that LIBS line, it's just plain wrong.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      1

                                      45/53

                                      18 Jun 2022, 17:24

                                      • Login

                                      • Login or register to search.
                                      45 out of 53
                                      • First post
                                        45/53
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved