How to use the API in linux system

52 views
Skip to first unread message

韩煦深

unread,
Jul 1, 2014, 12:25:23 AM7/1/14
to tesser...@googlegroups.com
Hi all!
I'm a Chinese student and I want to use the tesseract-ocr in our linux system. I have Ubuntu OS and I install tesseract in my ubuntu system.
But I don't know how to use C++ API in linux system because all the examples are based on VC++ and VS2010 maybe. In linux I can't use VC++ so If you know how to use API based on gcc or g++ in linux system, Thank a lot!

Nick White

unread,
Jul 1, 2014, 11:17:39 AM7/1/14
to tesser...@googlegroups.com
Hi,
Sure. The examples given in
https://code.google.com/p/tesseract-ocr/wiki/APIExample should
certainly work fine for g++ in Linux.

I'm guessing you're asking what build commands you need. It works in
quite a standard way, so nothing weird. Something like this should
work fine:

g++ -o myprogram myprogram.cpp -g -Wall -llept -ltesseract

If tesseract (or leptonica) is installed in a different place to the standard,
you can specify it like this:

g++ -o myprogram myprogram.cpp -g -Wall -I/home/nick/local/include/tesseract -L/home/nick/local/lib -llept -ltesseract

Let us know if you need anything more. I'll probably add these examples to the
wiki soon, thanks for the prompt :)

Nick
Reply all
Reply to author
Forward
0 new messages