4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8
<html xmlns="http://www.w3.org/1999/xhtml">
10
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
<title>Programming with libtesseract — Visual Studio 2008 Developer Notes for Tesseract-OCR</title>
14
<link rel="stylesheet" href="_static/tesseract.css" type="text/css" />
15
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
17
<script type="text/javascript">
18
var DOCUMENTATION_OPTIONS = {
21
COLLAPSE_INDEX: false,
26
<script type="text/javascript" src="_static/jquery.js"></script>
27
<script type="text/javascript" src="_static/underscore.js"></script>
28
<script type="text/javascript" src="_static/doctools.js"></script>
29
<script type="text/javascript" src="_static/sidebar.js"></script>
30
<link rel="top" title="Visual Studio 2008 Developer Notes for Tesseract-OCR" href="index.html" />
31
<link rel="next" title="Handy free tools" href="tools.html" />
32
<link rel="prev" title="Building Tesseract-OCR" href="building.html" />
34
<link href='http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
35
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css'>
36
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,400italic,700,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
43
<li class="right" style="margin-right: 10px">
44
<a href="tools.html" title="Handy free tools"
45
accesskey="N">next</a></li>
47
<a href="building.html" title="Building Tesseract-OCR"
48
accesskey="P">previous</a> |</li>
49
<li><a href="http://code.google.com/p/tesseract-ocr/">Tesseract-OCR Home</a> »</li>
51
<li><a href="index.html">Visual Studio 2008 Developer Notes</a> »</li>
56
<div class="document">
57
<div class="documentwrapper">
58
<div class="bodywrapper">
61
<div class="section" id="programming-with-libtesseract">
62
<h1>Programming with <span class="filesystem">libtesseract</span><a class="headerlink" href="#programming-with-libtesseract" title="Permalink to this headline">¶</a></h1>
63
<p>To use <span class="filesystem">libtesseract</span> in your own application you need to include
64
<strong>Leptonica</strong>’s <span class="filesystem">allheaders.h</span>, and <strong>Tesseract-OCR</strong>’s <span class="filesystem">baseapi.h</span> and
65
<span class="filesystem">strngs.h</span>.</p>
66
<p><strong>Tesseract-OCR</strong> uses <span class="filesystem">liblept</span> mainly for image I/O, but you can also use
67
any of <strong>Leptonica</strong>’s <em>many</em> image processing functions on <tt class="docutils literal"><span class="pre">PIX</span></tt>,
68
while at the same time calling <tt class="docutils literal"><span class="pre">TessBaseAPI</span></tt> methods. See the
69
<a class="reference external" href="http://tpgit.github.com/UnOfficialLeptDocs/">Leptonica documentation</a>
71
<p>There doesn’t seem to be any documentation on <span class="filesystem">api\baseapi.h</span>, but it
72
has extensive comments. You can also look at the <a class="reference internal" href="#apitest"><em>APITest Sample</em></a> and
73
<a class="reference internal" href="#apiexamples"><em>APIExamples</em></a> projects.</p>
74
<p>See the <a class="reference internal" href="#apitest"><em>APITest Sample</em></a> project for an example of which compiler and
75
linker settings you need for various build configurations. The easiest
76
way to begin a new application is to just make a copy of the <span class="filesystem">APITest</span>
77
directory. See <a class="reference internal" href="maintenance.html#copying-a-project"><em>this step</em></a> for detailed
78
instructions (skip the last step about adding <em class="guilabel">Project
79
Dependencies</em>).</p>
80
<p>If you want to manually set the required settings, then here’s the list
83
<li><p class="first">Add the following <em class="guilabel">Preprocessor Definitions</em> when compiling
84
any files that include <span class="filesystem">baseapi.h</span> and you are linking with the
85
static library versions of <span class="filesystem">libtesseract</span>:</p>
86
<div class="highlight-none"><div class="highlight"><pre>USE_STD_NAMESPACE
89
<p>If you are linking with the DLL versions of <span class="filesystem">libtesseract</span> instead
91
<div class="highlight-none"><div class="highlight"><pre>USE_STD_NAMESPACE;TESSDLL_IMPORTS;CCUTIL_IMPORTS;LIBLEPT_IMPORTS
95
<li><p class="first">Be sure to add the following to <em class="guilabel">Additional Include
97
<div class="highlight-none"><div class="highlight"><pre>C:\BuildFolder\include
98
C:\BuildFolder\include\leptonica
100
C:\BuildFolder\include\tesseract or
102
<tesseract-3.0x dir> (all its sub-directories that contain header files)
106
<li><p class="first">Add <span class="filesystem">C:\BuildFolder\lib</span> to your <em class="guilabel">Additional Library
107
Directories</em>.</p>
109
<li><p class="first">In the <span class="filesystem">C:\BuildFolder\include</span> directory are two Visual Studio
110
Property Sheet files:</p>
111
<div class="highlight-none"><div class="highlight"><pre>tesseract_versionnumbers.vsprops
112
leptonica_versionnumbers.vsprops
115
<p>Using <span class="filesystem">tesseract_versionnumbers.vsprops</span> (which automatically inherits
116
<span class="filesystem">leptonica_versionnumbers.vsprops</span>) can make it easier to specify the
117
libraries you need to import. For example, when creating a staticly
118
linked debug executable you can say:</p>
119
<div class="highlight-none"><div class="highlight"><pre>zlib$(ZLIB_VERSION)-static-mtdll-debug.lib
120
libpng$(LIBPNG_VERSION)-static-mtdll-debug.lib
121
libjpeg$(LIBJPEG_VERSION)-static-mtdll-debug.lib
122
giflib$(GIFLIB_VERSION)-static-mtdll-debug.lib
123
libtiff$(LIBTIFF_VERSION)-static-mtdll-debug.lib
124
liblept$(LIBLEPT_VERSION)-static-mtdll-debug.lib
125
libtesseract$(LIBTESS_VERSION)-static-debug.lib
128
<p>to make your application less dependent on library version numbers.</p>
129
<p>To add the Property Sheet to a Project, open its <em class="guilabel">Properties
130
Pages</em> Dialog, and set the <em class="guilabel">Configuration Properties |
131
General | Inherited Project Property Sheets</em> item to:</p>
132
<div class="highlight-none"><div class="highlight"><pre>..\..\..\include\tesseract_versionnumbers.vsprops
135
<p>Choosing <em class="menuselection"><span class="accelerator">V</span>iew ‣ Oth<span class="accelerator">e</span>r Windows ‣ Property
136
<span class="accelerator">M</span>anager</em> from the menubar will let you see the Properties attached
137
to each Project’s configurations.</p>
140
<div class="admonition note">
141
<p class="first admonition-title">Note</p>
142
<p class="last">The DLL versions of <span class="filesystem">libtesseract</span> currently only export the
143
<tt class="docutils literal"><span class="pre">TessBaseAPI</span></tt> C++ class from <span class="filesystem">baseapi.h</span>, there is no C function
146
<div class="admonition note">
147
<p class="first admonition-title">Note</p>
148
<p class="last">The DLL versions of <span class="filesystem">libtesseract</span> currently only export the
149
<tt class="docutils literal"><span class="pre">TessBaseAPI</span></tt> and <tt class="docutils literal"><span class="pre">STRING</span></tt> classes. In theory, all you need is
150
are those classes. However, if you find yourself having to manipulate
151
other “internal” tesseract objects then you currently have to link
152
with the <strong>static library</strong> versions of <span class="filesystem">libtesseract</span>.</p>
154
<div class="admonition warning">
155
<p class="first admonition-title">Warning</p>
156
<p class="last">The Release versions of <span class="filesystem">liblept</span>, by design, <em>never</em> print out any
157
possibly helpful messages to the console. Therefore, it is highly
158
recommended that you do your initial development using the Debug
159
versions of <span class="filesystem">liblept</span>. See <a class="reference external" href="http://tpgit.github.com/UnOfficialLeptDocs/leptonica/README.html#compile-time-control-over-stderr-output">Compile-time control over stderr output</a>
162
<p><<<Need to add the URL of the zip file that contains include & lib
163
directory contents for those people who don’t want to build libtesseract
164
themselves>>></p>
165
<div class="section" id="debugging-tips">
166
<h2>Debugging Tips<a class="headerlink" href="#debugging-tips" title="Permalink to this headline">¶</a></h2>
167
<p>Before debugging programs written with <span class="filesystem">libtesseract</span>, you should first
168
download the latest Leptonica sources (currently
169
<span class="filesystem">leptonica-1.68.tar.gz</span>) and VS2008 source package (<span class="filesystem">vs2008-1.68.zip</span>)
172
<li><p class="first"><a class="reference external" href="http://code.google.com/p/leptonica/downloads/detail?name=leptonica-1.68.tar.gz">http://code.google.com/p/leptonica/downloads/detail?name=leptonica-1.68.tar.gz</a></p>
174
<li><p class="first"><a class="reference external" href="http://code.google.com/p/leptonica/downloads/detail?name=vs2008-1.68.zip">http://code.google.com/p/leptonica/downloads/detail?name=vs2008-1.68.zip</a></p>
177
<p>Unpack them to <span class="filesystem">C:\BuildFolder</span> to get the following directory structure:</p>
178
<div class="highlight-none"><div class="highlight"><pre>C:\BuildFolder\
189
<p>(see <a class="reference external" href="http://tpgit.github.com/UnOfficialLeptDocs/vs2008/building-liblept.html">Building the liblept library</a>
190
for more information)</p>
191
<p><strong>Tesseract-OCR</strong> uses <strong>Leptonica</strong> “under the hood” for all (most? some?)
192
of its image processing operations. Having the source available (and
193
compiling it in debug mode) will make it easier to see what’s really
195
<p>You might want to add
196
<span class="filesystem">C:\BuildFolder\leptonica-1.68\vs2008\leptonica.vcproj</span> and
197
<span class="filesystem">C:\BuildFolder\tesseract-3.02\vs2008\libtesseract\libtesseract.vcproj</span>
198
to your solution by right-clicking it and choosing <em class="menuselection">A<span class="accelerator">d</span>d ‣
199
<span class="accelerator">E</span>xisting Project...</em>. This seems to make VS2008’s Intellisense <a class="reference external" href="http://tpgit.github.com/UnOfficialLeptDocs/vs2008/building-other-programs.html#intellisense-and-liblept">work
201
when finding “external” source files.</p>
202
<p>Definitely create a <tt class="docutils literal"><span class="pre">TESSDATA_PREFIX``x</span> <span class="pre">environment</span> <span class="pre">variable</span> <span class="pre">so</span> <span class="pre">that</span> <span class="pre">it</span>
203
<span class="pre">contains</span> <span class="pre">the</span> <span class="pre">absolute</span> <span class="pre">path</span> <span class="pre">of</span> <span class="pre">the</span> <span class="pre">directory</span> <span class="pre">that</span> <span class="pre">contains</span> <span class="pre">the</span>
204
<span class="pre">``tessdata</span></tt> directory. Otherwise you’ll have to put a <tt class="docutils literal"><span class="pre">tessdata</span></tt>
205
directory in every temporary build folder which quickly becomes painful
206
(especially since tessdata has gotten very big — 600MB!).</p>
208
<div class="section" id="apitest-sample">
209
<span id="apitest"></span><h2>APITest Sample<a class="headerlink" href="#apitest-sample" title="Permalink to this headline">¶</a></h2>
210
<p>The <em class="guilabel">APITest</em> Solution contains the minimal settings needed to
211
link with <span class="filesystem">libtesseract</span>. It demonstrates the typical situation, where
212
the “external” application’s source files reside <em>outside</em> of the
213
<span class="filesystem">tesseract-3.0x</span> directory tree.</p>
214
<p>To build the <span class="filesystem">vs2008\APITest</span> Solution, first copy it to your
215
<span class="filesystem">C:\BuildFolder</span> directory. This should now look like:</p>
216
<div class="highlight-none"><div class="highlight"><pre>C:\BuildFolder\
222
leptonica_versionnumbers.vsprops
223
tesseract_versionnumbers.vsprops
226
giflib416-static-mtdll-debug.lib
227
giflib416-static-mtdll.lib
228
libjpeg8c-static-mtdll-debug.lib
229
libjpeg8c-static-mtdll.lib
230
liblept168-static-mtdll-debug.lib
231
liblept168-static-mtdll.lib
236
libpng143-static-mtdll-debug.lib
237
libpng143-static-mtdll.lib
242
libtesseract302-static.lib
243
libtesseract302-static-debug.lib
244
libtiff394-static-mtdll-debug.lib
245
libtiff394-static-mtdll.lib
246
zlib125-static-mtdll-debug.lib
247
zlib125-static-mtdll.lib
263
<p>The <em class="guilabel">APITest</em> contains just the <em class="guilabel">baseapitester</em>
264
project. This was created using the VS2008 <em class="guilabel">Win32 Console
265
Application</em> Project Wizard and then just copying most of
266
<span class="filesystem">tesseractmain.cpp</span> and making minor edits. Its settings correctly refer
267
to the “public” <span class="filesystem">include</span> and <span class="filesystem">lib</span> directories using relative paths.</p>
268
<p>It assumes that the <span class="filesystem">C:\BuildFolder\include</span> directory has been
269
properly setup. See <a class="reference internal" href="setup.html#copying-headers"><em>this</em></a> for more details.</p>
270
<p>The <span class="filesystem">C:\BuildFolder\lib</span> directory will automatically get
271
<span class="filesystem">libtesseract</span> copied to it whenever it is built.</p>
272
<p>The <span class="filesystem">include\tesseract_versionnumbers.vsprops</span> Property Sheet is used
273
to avoid explicit library version number dependencies. Precompiled
274
headers are used. <em class="guilabel">LIB_Release</em>, <em class="guilabel">LIB_Debug</em>,
275
<em class="guilabel">DLL_Release</em>, and <em class="guilabel">DLL_Debug</em> build configurations
277
<p>The following are the compiler command lines and linker options
278
used. See <a class="reference external" href="http://msdn.microsoft.com/en-us/library/9s7c9wdw(v=vs.90).aspx">Compiling a C/C++ Program | Compiler Options</a> for a
279
detailed explanation of these options.</p>
280
<p id="apitest-lib-release"><em class="guilabel">LIB_Release</em> C/C++ <em class="guilabel">Command Line</em>:</p>
281
<div class="highlight-none"><div class="highlight"><pre>/O2
282
/I "." /I "..\..\include" /I "..\..\include\leptonica"
283
/I "..\..\include\tesseract"
284
/D "WIN32" /D "_WINDOWS" /D "NDEBUG"
285
/D "USE_STD_NAMESPACE" /D "_MBCS"
286
/FD /EHsc /MD /Yc"stdafx.h"
287
/Fp"LIB_Release\baseapitester.pch" /Fo"LIB_Release\\"
288
/Fd"LIB_Release\vc90.pdb"
290
/wd4244 /wd4305 /wd4018 /wd4267 /wd4996 /wd4800 /wd4005 /wd4355 /wd4099 /wd4566
294
<p><em class="guilabel">LIB_Release</em> Linker <em class="guilabel">Additional Dependencies</em>:</p>
295
<div class="highlight-none"><div class="highlight"><pre>ws2_32.lib
297
zlib$(ZLIB_VERSION)-static-mtdll.lib
298
libpng$(LIBPNG_VERSION)-static-mtdll.lib
299
libjpeg$(LIBJPEG_VERSION)-static-mtdll.lib
300
giflib$(GIFLIB_VERSION)-static-mtdll.lib
301
libtiff$(LIBTIFF_VERSION)-static-mtdll.lib
302
liblept$(LIBLEPT_VERSION)-static-mtdll.lib
303
libtesseract$(LIBTESS_VERSION)-static.lib
306
<p><em class="guilabel">LIB_Debug</em> C/C++ <em class="guilabel">Command Line</em>:</p>
307
<div class="highlight-none"><div class="highlight"><pre>/Od
308
/I "." /I "..\..\include" /I "..\..\include\leptonica"
309
/I "..\..\include\tesseract"
310
/D "WIN32" /D "_WINDOWS" /D "_DEBUG"
311
/D "USE_STD_NAMESPACE" /D "_MBCS"
312
/FD /EHsc /RTC1 /MDd /Yc"stdafx.h"
313
/Fp"LIB_Debug\baseapitesterd.pch" /Fo"LIB_Debug\\"
314
/Fd"LIB_Debug\vc90.pdb"
316
/wd4244 /wd4305 /wd4018 /wd4267 /wd4996 /wd4800 /wd4005 /wd4355 /wd4099 /wd4566
320
<p><em class="guilabel">LIB_Debug</em> Linker <em class="guilabel">Additional Dependencies</em>:</p>
321
<div class="highlight-none"><div class="highlight"><pre>ws2_32.lib
323
zlib$(ZLIB_VERSION)-static-mtdll-debug.lib
324
libpng$(LIBPNG_VERSION)-static-mtdll-debug.lib
325
libjpeg$(LIBJPEG_VERSION)-static-mtdll-debug.lib
326
giflib$(GIFLIB_VERSION)-static-mtdll-debug.lib
327
libtiff$(LIBTIFF_VERSION)-static-mtdll-debug.lib
328
liblept$(LIBLEPT_VERSION)-static-mtdll-debug.lib
329
libtesseract$(LIBTESS_VERSION)-static-debug.lib
332
<p><em class="guilabel">DLL_Release</em> C/C++ <em class="guilabel">Command Line</em>:</p>
333
<div class="highlight-none"><div class="highlight"><pre>/O2
334
/I "." /I "..\..\include" /I "..\..\include\leptonica"
335
/I "..\..\include\tesseract"
336
/D "WIN32" /D "_WINDOWS" /D "NDEBUG"
337
/D "USE_STD_NAMESPACE" /D "_MBCS"
338
/D "TESSDLL_IMPORTS" /D "CCUTIL_IMPORTS" /D "LIBLEPT_IMPORTS"
339
/FD /EHsc /MD /Yc"stdafx.h"
340
/Fp"DLL_Release\baseapitester-dll.pch" /Fo"DLL_Release\\"
341
/Fd"DLL_Release\vc90.pdb"
343
/wd4244 /wd4305 /wd4018 /wd4267 /wd4996 /wd4800 /wd4005 /wd4355 /wd4099 /wd4566
347
<p><em class="guilabel">DLL_Release</em> Linker <em class="guilabel">Additional Dependencies</em>:</p>
348
<div class="highlight-none"><div class="highlight"><pre>ws2_32.lib
350
liblept$(LIBLEPT_VERSION).lib
351
libtesseract$(LIBTESS_VERSION).lib
354
<p><em class="guilabel">DLL_Debug</em> C/C++ <em class="guilabel">Command Line</em>:</p>
355
<div class="highlight-none"><div class="highlight"><pre>/Od
356
/I "." /I "..\..\include" /I "..\..\include\leptonica"
357
/I "..\..\include\tesseract"
358
/D "WIN32" /D "_WINDOWS" /D "_DEBUG"
359
/D "USE_STD_NAMESPACE" /D "_MBCS"
360
/D "TESSDLL_IMPORTS" /D "CCUTIL_IMPORTS" /D "LIBLEPT_IMPORTS"
361
/FD /EHsc /RTC1 /MDd /Yc"stdafx.h"
362
/Fp"DLL_Debug\baseapitester-dlld.pch" /Fo"DLL_Debug\\"
363
/Fd"DLL_Debug\vc90.pdb"
365
/wd4244 /wd4305 /wd4018 /wd4267 /wd4996 /wd4800 /wd4005 /wd4355 /wd4099 /wd4566
369
<p><em class="guilabel">DLL_Debug</em> Linker <em class="guilabel">Additional Dependencies</em>:</p>
370
<div class="highlight-none"><div class="highlight"><pre>ws2_32.lib
372
liblept$(LIBLEPT_VERSION)d.lib
373
libtesseract$(LIBTESS_VERSION)d.lib
377
<div class="section" id="apiexamples">
378
<span id="id1"></span><h2>APIExamples<a class="headerlink" href="#apiexamples" title="Permalink to this headline">¶</a></h2>
379
<p><<<NEEDS WORK>>></p>
380
<p>Currently two Projects are in this solution:</p>
382
<li><p class="first">preprocessing – Demonstrates how to use <strong>Leptonica</strong>’s image
383
processing functions to clean up images <em>before</em> calling
384
<tt class="docutils literal"><span class="pre">TessBaseAPI::SetImage()</span></tt>.</p>
386
<li><p class="first">getinfo – Demonstrates calling various <tt class="docutils literal"><span class="pre">TessBaseAPI</span></tt> methods to get
387
back information on the OCR process.</p>
391
<div class="section" id="tesseractocr-preprocessor-definitions">
392
<h2><strong>Tesseract-OCR</strong> preprocessor definitions<a class="headerlink" href="#tesseractocr-preprocessor-definitions" title="Permalink to this headline">¶</a></h2>
393
<dl class="docutils">
394
<dt><tt class="docutils literal"><span class="pre">HAVE_CONFIG_H</span></tt></dt>
395
<dd><p class="first">Only defined when building under Linux. This causes the inclusion of
396
<span class="filesystem">config_auto.h</span>, which is only auto-generated during the <span class="filesystem">./configure</span>
397
process and thus <em>not</em> visible on Windows.</p>
398
<p class="last">This is what sets the <tt class="docutils literal"><span class="pre">VERSION</span></tt> macro (and lots of other
399
configuration related macros).</p>
401
<dt><tt class="docutils literal"><span class="pre">TESSDLL_EXPORTS</span></tt></dt>
402
<dd>Only used when <em>building</em> DLL versions of <span class="filesystem">libtesseract</span>.</dd>
403
<dt><tt class="docutils literal"><span class="pre">TESSDLL_IMPORTS</span></tt></dt>
404
<dd><p class="first">Should be defined when building apps that link to a DLL version of
405
<span class="filesystem">libtesseract</span>. Used as follows in <span class="filesystem">baseapi.h</span>:</p>
406
<div class="highlight-none"><div class="highlight"><pre>#ifdef TESSDLL_EXPORTS
407
#define TESSDLL_API __declspec(dllexport)
408
#elif defined(TESSDLL_IMPORTS)
409
#define TESSDLL_API __declspec(dllimport)
415
<p class="last">If you don’t define this then you’ll get “undefined external symbol”
418
<dt><tt class="docutils literal"><span class="pre">TESSDLL_API</span></tt></dt>
419
<dd>Used to mark classes for export (visibility) in DLL versions of
420
<span class="filesystem">libtesseract</span>. Currently <em>only</em> used with the <tt class="docutils literal"><span class="pre">TestBaseAPI</span></tt> class.</dd>
421
<dt><tt class="docutils literal"><span class="pre">CCUTIL_EXPORTS</span></tt></dt>
422
<dd>Only used when <em>building</em> DLL versions of <span class="filesystem">libtesseract</span>.</dd>
423
<dt><tt class="docutils literal"><span class="pre">CCUTIL_IMPORTS</span></tt></dt>
424
<dd><p class="first">Should be defined when building apps that link to a DLL version of
425
<span class="filesystem">libtesseract</span>. Used as follows in <span class="filesystem">strngs.h</span>:</p>
426
<div class="highlight-none"><div class="highlight"><pre>#ifdef CCUTIL_EXPORTS
427
#define CCUTIL_API __declspec(dllexport)
428
#elif defined(CCUTIL_IMPORTS)
429
#define CCUTIL_API __declspec(dllimport)
435
<p class="last">If you don’t define this then you’ll get “undefined external symbol STRING”
438
<dt><tt class="docutils literal"><span class="pre">LIBLEPT_IMPORTS</span></tt></dt>
439
<dd><p class="first">Should be defined when building apps that link to a DLL version of
440
<strong>Leptonica</strong>. Used as follows in environ.h:</p>
441
<div class="highlight-none"><div class="highlight"><pre>#if defined(LIBLEPT_EXPORTS) || defined(LEPTONLIB_EXPORTS)
442
#define LEPT_DLL __declspec(dllexport)
443
#elif defined(LIBLEPT_IMPORTS) || defined(LEPTONLIB_IMPORTS)
444
#define LEPT_DLL __declspec(dllimport)
450
<p class="last">If you don’t define this then you’ll get “undefined external symbol”
453
<dt><tt class="docutils literal"><span class="pre">USE_STD_NAMESPACE</span></tt></dt>
454
<dd><p class="first">Causes the following to be done:</p>
455
<div class="last highlight-none"><div class="highlight"><pre>#ifdef USE_STD_NAMESPACE
462
<dt><tt class="docutils literal"><span class="pre">_WIN32</span></tt></dt>
463
<dd><p class="first">Used to indicate that the build target is Windows 32-bit or
464
64-bit (<tt class="docutils literal"><span class="pre">WIN32</span></tt> and <tt class="docutils literal"><span class="pre">WINDOWS</span></tt> are also added by the New Project
466
<p class="last">See <a class="reference external" href="http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.90).aspx">C/C+ Preprocessor Reference | The Preprocessor | Macros |
467
Predefined Macros</a> for
468
the complete list for Visual Studio 2008.</p>
470
<dt><tt class="docutils literal"><span class="pre">_MSC_VER</span></tt></dt>
471
<dd>Used to check specifically for building with the VC++ compiler (as
472
opposed to the MinGW gcc compiler).</dd>
473
<dt><tt class="docutils literal"><span class="pre">_USRDLL</span></tt></dt>
474
<dd>Only defined when building the DLL versions of <span class="filesystem">libtesseract</span>.</dd>
475
<dt><tt class="docutils literal"><span class="pre">_MBCS</span></tt></dt>
476
<dd>Automatically defined when <em class="guilabel">Configuration Properties |
477
General | Character Set</em> is set to <em class="guilabel">Use Multi-Byte
478
Character Set</em>.</dd>
479
<dt><tt class="docutils literal"><span class="pre">DLLSYM</span></tt></dt>
480
<dd><a class="reference external" href="http://groups.google.com/group/tesseract-dev/msg/5e0f7f7fab27b463">Obsolete</a>
481
and can be ignored.</dd>
490
<div class="sphinxsidebar">
491
<div class="sphinxsidebarwrapper">
495
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a></li>
496
<li class="toctree-l1"><a class="reference internal" href="setup.html">Setting up <strong>Tesseract-OCR</strong></a></li>
497
<li class="toctree-l1"><a class="reference internal" href="building.html">Building <strong>Tesseract-OCR</strong></a></li>
498
<li class="toctree-l1 current"><a class="current reference internal" href="">Programming with <span class="filesystem">libtesseract</span></a><ul>
499
<li class="toctree-l2"><a class="reference internal" href="#debugging-tips">Debugging Tips</a></li>
500
<li class="toctree-l2"><a class="reference internal" href="#apitest-sample">APITest Sample</a></li>
501
<li class="toctree-l2"><a class="reference internal" href="#apiexamples">APIExamples</a></li>
502
<li class="toctree-l2"><a class="reference internal" href="#tesseractocr-preprocessor-definitions"><strong>Tesseract-OCR</strong> preprocessor definitions</a></li>
505
<li class="toctree-l1"><a class="reference internal" href="tools.html">Handy free tools</a></li>
506
<li class="toctree-l1"><a class="reference internal" href="maintenance.html">Maintaining the VS2008 directory</a></li>
507
<li class="toctree-l1"><a class="reference internal" href="vs2010-notes.html">Using Visual Studio 2010</a></li>
508
<li class="toctree-l1"><a class="reference internal" href="versions.html">Version Notes</a></li>
512
<div id="searchbox" style="display: none">
513
<h3>Quick search</h3>
514
<form class="search" action="search.html" method="get">
515
<input type="text" name="q" />
516
<input type="submit" value="Go" />
517
<input type="hidden" name="check_keywords" value="yes" />
518
<input type="hidden" name="area" value="default" />
520
<p class="searchtip" style="font-size: 90%">
521
Enter search terms or a module, class or function name.
524
<script type="text/javascript">$('#searchbox').show(0);</script>
527
<div class="clearer"></div>
529
<div class="related">
532
<li class="right" style="margin-right: 10px">
533
<a href="tools.html" title="Handy free tools"
536
<a href="building.html" title="Building Tesseract-OCR"
538
<li><a href="http://code.google.com/p/tesseract-ocr/">Tesseract-OCR Home</a> »</li>
540
<li><a href="index.html">Visual Studio 2008 Developer Notes</a> »</li>
545
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
b'\\ No newline at end of file'