title: Using Tesseract OCR in VC++
body: <p>In my project I have to read the numbers from the image(.jpg or .tiff). After googling a lot, I came to know about the open OCR i.e., Tesseract OCR. Am begginer for Tesseract OCR, I read all the documentation of tesseract &amp; how to use it in Visual studio. Bascically am facing some problem in using tesseract... I followed the steps like this:</p>
  
  <p>1) Downloaded &amp; Installed tesseract-ocr-setup-3.02.02.exe from <a href="http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-setup-3.02.02.exe" rel="nofollow">http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-setup-3.02.02.exe</a></p>
  
  <p>2)Open up Microsoft Visual Studio 2008 and go to Tools -> Options
  Project solutions -> VC++ Directories -> Show directories for include files</p>
  
  <p>Add:<br>
  C:\Program Files\Tesseract-OCR\include<br>
  C:\Program Files\Tesseract-OCR\include\tesseract<br>
  C:\Program Files\Tesseract-OCR\include\leptonica  </p>
  
  <p>3) Next click show directories for -> Library Files<br>
  Add:
  C:\Program Files\Tesseract-OCR\lib</p>
  
  <p>4) Configure linker options for Tesseract<br>
  Right click your project in solution explorer and click properties<br>
  Configuration Properties -> Linker->Input ->Additional Dependencies<br>
  Add this in there:<br>
  libtesseract302.lib<br>
  libtesseract302d.lib<br>
  liblept168.lib<br>
  liblept168d.lib  </p>
  
  <p>5) Copy  liblept168.dll, liblept168d.dll, libtesseract302.dll and libtesseract302.dll from C:\Program Files\Tesseract-OCR\ into your project folder </p>
  
  <p>6) main.cpp source file looks like this :  </p>
  
  <pre><code>#include&lt;baseapi.h&gt;
  #include &lt;allheaders.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main(void){
  
      tesseract::TessBaseAPI api;
      api.Init("", "eng", tesseract::OEM_DEFAULT);
      api.SetPageSegMode(static_cast&lt;tesseract::PageSegMode&gt;(7));
      api.SetOutputName("out");
  
      cout&lt;&lt;"File name:";
      char image[256];
      cin&gt;&gt;image;
      PIX   *pixs = pixRead(image);
  
      STRING text_out;
      api.ProcessPages(image, NULL, 0, &amp;text_out);
  
      cout&lt;&lt;text_out.string();
  
  }
  </code></pre>
  
  <p>The problem is am unable to compile this code.. Am getting linker error i.e., LINK : fatal error LNK1181: cannot open input file 'libtesseract302.lib'.<br>
  As I downloaded Tesseract OCR. In Tesseract-OCR\lib am not finding libtesseract302.dll and libtesseract302.dll files.. Am able to see only liblept168.dll, liblept168d.dll files.<br>
  I tried to searching for libtesseract302.lib &amp; libtesseract302.dll but am not getting anything.<br>
  Am totally struck up at this point.<br>
  If anyone has used Tesseract OCR, please suggest me on this.</p>
  
  <p>Thank you all..</p>