Qt and Tesseract Linkage
-
So my next step must be here
Mingw-w64Mingw-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?
-
Why are you following the cross-compilation instructions from Linux to Windows ?
-
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.
-
As usual, point INCLUDEPATH to that folder, then LIBS to the one containing the library files and link against these libraries.
-
-
Here is my pro file
Any thoughts how can I amend this to make it work?QT += core
QT -= guiCONFIG += c++11
TARGET = openCV
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
INCLUDEPATH += C:\opencv\release\install\includeLIBS += 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.dllLIBS += -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_videostab249dINCLUDEPATH+=D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract
LIBS +=-D:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseractINCLUDEPATH+=D:\MinGW\msys\1.0\src\leptonica-1.68\src
LIBS +=-D:\MinGW\msys\1.0\src\leptonica-1.68\srcSOURCES += main.cpp
DEFINES += QT_DEPRECATED_WARNINGS
-
@OlegD
A path oftesseract/baseapi.h
cannot be found relative toD:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract
, can it? That would havetesseract\tesseract
in the middle of it. If you want to findtesseract/baseapi.h
you need to start looking fromD:\MinGW\msys\1.0\src\tesseract-ocr\include
.This is not a Qt issue, just plain C++.
-
@OlegD
If you haveD:\MinGW\msys\1.0\src\tesseract-ocr\include
in yourINCLUDEPATH
, your code has#include <tesseract/baseapi.h>
and the filebaseapi.h
exists inD:\MinGW\msys\1.0\src\tesseract-ocr\include\tesseract
then I do not see why you would getfatal 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?
-
@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\includeRemove that LIBS line, it's just plain wrong.