-
September 24th, 2018, 05:15 AM
#1
Using Tesseract in MFC
I am struggle to use tesseract library into MFC VS2010 project. And I guess I started like this: I have tried to compile tesseract library from here: https://github.com/tesseract-ocr/tesseract ... but when I tried to create a solution with CMake, I get the following error from CMake:
Code:
CMake Error at CMakeLists.txt:100 (find_package):
Could not find a package configuration file provided by "Leptonica"
(requested version 1.74) with any of the following names:
LeptonicaConfig.cmake
leptonica-config.cmake
Add the installation prefix of "Leptonica" to CMAKE_PREFIX_PATH or set
"Leptonica_DIR" to a directory containing one of the above files. If
"Leptonica" provides a separate development package or SDK, be sure it has
been installed.
Obviously, I need leptonica ...but whre can I get this library ? I read that is used in tesseract projects ...
Or else, have you already compiled tesseract with VS2010 ? Can you lead me into solving my task ? Thank you.
-
September 24th, 2018, 05:27 AM
#2
Re: Using Tesseract in MFC
Victor Nijegorodov
-
September 24th, 2018, 05:44 AM
#3
Re: Using Tesseract in MFC
Originally Posted by VictorN
This problem I didn't searched on internet, I admit that .. thank you for idea. However, I didn't found something about leptonica library on github ....
Last edited by mesajflaviu; September 24th, 2018 at 05:49 AM.
-
September 24th, 2018, 06:05 AM
#4
Re: Using Tesseract in MFC
If I compile tesseact library in VS2017, could I use this compiled lib and dll into VS2010 project ?
Last edited by mesajflaviu; September 25th, 2018 at 07:27 AM.
-
September 24th, 2018, 06:08 AM
#5
Re: Using Tesseract in MFC
Because I have compiled Leptonica, but when I compile tesseract, I get a bunch of errors ... and I guess is because VS2010 compiler is the point:
Code:
3>c:\flaviu\tesseract-master\src\arch\dotproductavx.cpp(30): error C4716: 'tesseract::DotProductAVX' : must return a value
3>
3>Build FAILED.
3>
3>Time Elapsed 00:00:00.36
2>C:\Flaviu\tesseract-master\src\ccutil\host.h(30): fatal error C1083: Cannot open include file: 'cinttypes': No such file or directory
the code:
Code:
namespace tesseract {
double DotProductAVX(const double* u, const double* v, int n) {
fprintf(stderr, "DotProductAVX can't be used on Android\n");
abort();
}
} // namespace tesseract
and
Code:
#include <cinttypes> // PRId32, ...
-
September 24th, 2018, 06:31 AM
#6
Re: Using Tesseract in MFC
<cinttypes> was introduced with c++11 - so you need at least a c++11 compatible compiler. VS2010 is not c++11 compatible so you'll need a later version of the compiler to compile this code.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
September 24th, 2018, 06:34 AM
#7
Re: Using Tesseract in MFC
So, if I would compile this library with VS2017 let say, I could use this library inside of VS2010 project ?
-
September 24th, 2018, 06:37 AM
#8
Re: Using Tesseract in MFC
Originally Posted by mesajflaviu
So, if I would compile this library with VS2017 let say, I could use this library inside of VS2010 project ?
probably, yes.
Just try it!
Victor Nijegorodov
-
September 24th, 2018, 07:05 AM
#9
Re: Using Tesseract in MFC
Note that each version of VS c++ uses it's own version of the crt - so the.dll compiled with VS2017 will use a different version of the crt to code compiled with VS2010. This may, or may not, be an issue - but for any computer on which you want to run these programs you'll need to have at least these different versions of the crt installed.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
September 24th, 2018, 11:28 AM
#10
Re: Using Tesseract in MFC
Originally Posted by mesajflaviu
So, if I would compile this library with VS2017 let say, I could use this library inside of VS2010 project ?
Why ask? Just try it.
-
September 25th, 2018, 04:47 AM
#11
Re: Using Tesseract in MFC
From my experience, I knew that is impossible to go everything alright
I have installed VS2017 on my machine ... but when I have tried to create a simple MFC test project, I have met the following error:
Ok, so I have tried to create a solution file for tesseract, with CMake, and here is the result:
Code:
CMake Error at CMakeLists.txt:41 (project):
Generator
Visual Studio 15 2017
could not find any instance of Visual Studio.
Configuring incomplete, errors occurred!
See also "C:/Flaviu/tesseract-master/bin/CMakeFiles/CMakeOutput.log".
I run on the empty road ...
-
September 25th, 2018, 05:15 AM
#12
Re: Using Tesseract in MFC
Victor Nijegorodov
-
September 25th, 2018, 05:17 AM
#13
Re: Using Tesseract in MFC
No, of course not, and I have searched a solution for my problem, but I didn't found something relevant ... might haven't used right terms ...
Last edited by mesajflaviu; September 25th, 2018 at 07:11 AM.
-
September 25th, 2018, 05:58 AM
#14
Re: Using Tesseract in MFC
When you installed Vs2017, did you tell the installation configuration that you wanted c++/mfc/SDK etc etc for desktop? I don't think they are installed by default now.
Run the VS installer, click modify and under Installation Details, what have you installed for Desktop Development with C++?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
September 25th, 2018, 06:58 AM
#15
Re: Using Tesseract in MFC
Originally Posted by 2kaud
When you installed Vs2017, did you tell the installation configuration that you wanted c++/mfc/SDK etc etc for desktop? I don't think they are installed by default now.
Run the VS installer, click modify and under Installation Details, what have you installed for Desktop Development with C++?
Yes, I have checked these details, and I noticed that I haven't installed all components for my needs ... and I have installed them, and I have successfully compiled leptonica and tesseract library ... now it come to used them, inside of VS2010 project ... I am very curios if will work ...I will come back with feedback.
Last edited by mesajflaviu; September 25th, 2018 at 07:13 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|