On Wed, Feb 22, 2012 at 11:59 PM, Wout Bittremieux
<bittremi...@gmail.com> wrote:
> I have been trying to include Tesseract in my Visual Studio 2010
> project in order to be able to use the API calls. Because my knowledge
> about building and using libraries in Visual Studio is rather
> superficial, this has presented me with several problems. I have
> managed to straighten out some of these problems by googling and
> reading this group as well as the dev group, however some problems
> still remain. Which is why I turn to some smarter people like you,
> hoping to get some help with these issues.
>
> In order to build the Tesseract library in Visual Studio 2010 I have
> largely been following Tom Powers' guidelines for Visual Studio 2008
> [1], making small adjustments where deemed necessary. These guidelines
> have been extremely helpful in order to make some progress. The
> version I used while building is Tesseract v3.01, because I wanted to
> have a stable working version first before trying a version from the
> SVN.
>
> I have been able to successfully build libtesseract in all four of the
> build configurations (Debug, Debug.dll, Release, Release.dll).
> However, when trying to use the built library files in my own project,
> unfortunately I had less success.
>
> Both the Release and the Release.dll library files work correctly.
> This has enabled me to use Tesseract in my own project successfully.
> Unfortunately, I can't seem to get both the Debug and the Debug.dll
> versions to work. Although using Tesseract in Release mode allows me
> to implement its functionality, of course while writing complicated
> code, a Debug solution is mandatory.
>
> In the Leptonica documentation, the Visual Studio 2010 Notes [2] say
> it should be possible to use a static VS2008 library in VS2010 without
> any problems. And it should also be possible to use a dynamic VS2008
> library when taking care of certain rules.
>
> Because using a static library should be possible, first I tried this
> approach. However, when trying to run my application linking to the
> static Tesseract library, I get the following error message:
>
> 'Unable to start program 'C:\...\....exe'.
>
> This application has failed to start because the application
> configuration is incorrect. Review the manifest file for possible
> errors. Reinstalling the application may fix this problem. For more
> details, see the application event log.'
>
> The application event log gave me the following information:
>
> 'Activation context generation failed for "C:\...\....exe". Dependent
> Assembly
> Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
> could not be found. Please use sxstrace.exe for detailed diagnosis.'
>
> I tried getting some more information by using Dependency Walker,
> however this largely presents the same error message.
> Researching this side-by-side error leads me to believe that some of
> the libraries still need a VS2008 debug library, which isn't available
> on my machine. Unfortunately I have no idea how I can fix this
> problem. Several message boards advertise different solutions of which
> I have tried a few, but without any positive result.
>
> Because the static library didn't work, I tried the dynamic library as
> well. By using the dynamic debug library, when I try to run my program
> I get an error message saying that 'the application failed to
> initialize properly'. Using Dependency Walker, the error seems to be
> that the provided LIBLEPT168D.DLL seems to need MSVCR90D.DLL, which of
> course isn't available on my Visual Studio 2010 machine. This is
> probably the same problem Tom Powers noted here [3].
> Because Dependency Walker indicated Leptonica needs the VS2008
> library, I tried building Leptonica myself with Visual Studio 2010. I
> managed to build it successfully, however when using this version of
> liblept instead of the downloadable version, I received the same error
> I got as with the static library.
>
> Now I have tried all these different things, but I am stuck for the
> moment. Does any one here knows how to fix this problem and use the
> Tesseract library in debug mode?
>
> Greetings,
> Wout
>
> ---
>
> [1] 
> https://groups.google.com/group/tesseract-dev/browse_thread/thread/c4ce347ad02f0c2c
> [2] http://tpgit.github.com/UnOfficialLeptDocs/vs2008/vs2010-notes.html
> [3] 
> http://stackoverflow.com/questions/4171403/using-visual-studio-2010-how-can-one-link-to-a-dll-generated-by-visual-studio-2
>

Try building and running leptonica's ioformat_reg program (which is my
canonical test case). If that doesn't work then you still have a
problem with building Leptonica and you don't need to worry about
tesseract yet. It might be (and probably is) that you'll have to
rebuild all the dependent image libraries versions also (which while
painful is doable by following the instruction on the Leptonica site
you referenced).

I have to admit that my machines have always had both VS2008 and
VS2010 installed on them, therefore I always have the required runtime
libraries. This may have been an issue all along and it just doesn't
apply to my special case. I gather the C Runtime Library
redistributions that Microsoft provides free don't come with the Debug
versions? I've never bothered to check.

As a workaround, I suppose you could always install the free VC++ 2008
express edition from [1]. Sort of a long way around to make sure you
get the MSVCR90D.DLL.

[1] http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express

-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesseract-ocr@googlegroups.com
To unsubscribe from this group, send email to
tesseract-ocr+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

Reply via email to