dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 38

Thread: Using Tesseract in MFC

  1. #1
    Join Date
    Jan 2009
    Posts
    270

    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.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,262

    Re: Using Tesseract in MFC

    Did you try to google for this problem?
    https://www.google.de/search?newwind....0.vEcAER2hEX8
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2009
    Posts
    270

    Re: Using Tesseract in MFC

    Quote Originally Posted by VictorN View Post
    Did you try to google for this problem?
    https://www.google.de/search?newwind....0.vEcAER2hEX8
    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.

  4. #4
    Join Date
    Jan 2009
    Posts
    270

    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.

  5. #5
    Join Date
    Jan 2009
    Posts
    270

    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, ...

  6. #6
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,515

    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++17 Compiler: Microsoft VS2017 (15.9.4)

  7. #7
    Join Date
    Jan 2009
    Posts
    270

    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 ?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,262

    Re: Using Tesseract in MFC

    Quote Originally Posted by mesajflaviu View Post
    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

  9. #9
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,515

    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++17 Compiler: Microsoft VS2017 (15.9.4)

  10. #10
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,844

    Re: Using Tesseract in MFC

    Quote Originally Posted by mesajflaviu View Post
    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.

  11. #11
    Join Date
    Jan 2009
    Posts
    270

    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:Name:  Untitled.jpg
Views: 57
Size:  12.0 KB
    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 ...

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,262

    Re: Using Tesseract in MFC

    Victor Nijegorodov

  13. #13
    Join Date
    Jan 2009
    Posts
    270

    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.

  14. #14
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,515

    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++17 Compiler: Microsoft VS2017 (15.9.4)

  15. #15
    Join Date
    Jan 2009
    Posts
    270

    Re: Using Tesseract in MFC

    Quote Originally Posted by 2kaud View Post
    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.

Page 1 of 3 123 LastLast

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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)