I want to build the tesseract 3.02.02 project so that I can modify some code to tune it to some specific task.
Version: tesseract 3.02.02
Ubuntu 12.04, Eclipse Juno
I put the tesseract into the Eclipse project.
Include directories
/usr/local/include
/usr/local
/usr/include/leptonica
and all file directories of the tesseract source, e.g. /Tesseract302Test/src/api, etc.
Library Paths:
/usr/local/lib
Libraries
/lept
Then I build the project.
The error pops out:
../src/training/classifier_tester.cpp:20:35: fatal error: base/commandlineflags.h: No such file or directory
compilation terminated.
There is no such commandlineflags.h file.
How can I solve this problem?
I search online a lot and fail to find an example. Most articles focus on compile tesseract to a library.
Thanks a lot in advance.
This is my first time to post the message on the group tesseract-ocr. Actually yesterday I tried to post the same message on tesseract-dev, but not succeed.
If it happens to appear on tesseract-dev at some point of later time, sorry for that. I just do not want to wait for too long.
Thanks.
Then where should I put
#define USE_STD_NAMESPACE?
I put it in the tesseractmain.h, but the same error appears: fatal error: base/commandlineflags.h: No such file or directory
Sorry if my question is dumb.
Thanks.
On Friday, November 16, 2012 2:47:50 PM UTC-6, zdenop wrote:
On Fri, Nov 16, 2012 at 3:03 AM, Linda Li <codingpo...@gmail.com> wrote:
There is no such commandlineflags.h file.If you would have a look at source, you could see that commandlineflags.h is part of conditional inclusion.How can I solve this problem?Define identifier USE_STD_NAMESPACE.
--
Zdenko
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-oc...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
I build it to run tessearctmain.cpp.
I do not intend to compile the whole
Thanks to instruction from Zdenko, I add the symbols as follows:
In Eclipse, Project Properties->C/C++ General->Paths and Symbols
Symbol, Value.
USE_STD_NAMESPACE
VERSION=\"3.02.02\"
Now building succeeds.
Compile has errors, complaining there are several main() functions.
I have little knowledge of makefile, which I guess can circumvent this problem, so I renamed all functions with main(), except tesseractmain.cpp, to .txt files.
Now the compiling errors are:
svutil.cpp:129: undefined reference to `sem_init'
svutil.cpp:137: undefined reference to `sem_post'
svutil.cpp:145: undefined reference to `sem_wait'
svutil.cpp:188: undefined reference to `pthread_create'
I search the word “sem_init”, which is in the configure file.
I do not understand the configure file.
Finding some commands containing “sem_init”
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
char sem_init ();
int
main ()
{
return sem_init ();
;
return 0;
}
Google, found http://code.google.com/p/tesseract-ocr/issues/detail?id=757
“The build fails as sem_init is in librt on Solaris. The attached patch adds searching for sem_init in librt. After that the build succeeds.”
Search librt in the libraries:
/usr/lib/x86_64-linux-gnu/
librt.a
librt.so
So I include /usr/lib/x86_64-linux-gnu into the Library Paths
Include rt into Libraries.
Rebuild the project with hope....
Again, the same compiling errors are:
svutil.cpp:129: undefined reference to `sem_init'
svutil.cpp:137: undefined reference to `sem_post'
svutil.cpp:145: undefined reference to `sem_wait'
svutil.cpp:188: undefined reference to `pthread_create'
I guess I need to include some header files. But I failed to find one.
Or do I have to learn autotool to achieve what I want?
An easy way?
Hah, I figured it out.
You are right, "undefined" does not mean "undeclared". So I think I found a one wrong lib.
I checked the Makefile, although a lot of strange words there, there are LIBS = -llept -lpthread
So I include pthread in it.
Now the tesseractmain.cpp builds. (only it, yes, I put other .cpp files containing main() to .txt files, wired, violent but worked : )
Thanks a lot for zdenop's help.
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-oc...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
Thanks.
On Monday, November 19, 2012 10:30:07 AM UTC-6, zdenop wrote:
On Sun, Nov 18, 2012 at 11:49 PM, Linda Li <codingpo...@gmail.com> wrote:Now building succeeds.
Compile has errors, complaining there are several main() functions.
I have little knowledge of makefile, which I guess can circumvent this problem, so I renamed all functions with main(), except tesseractmain.cpp, to .txt files.
Are you sure you know what are you doing?
I think it is an easy and feasible way, although sounds awkward.
Google, found http://code.google.com/p/tesseract-ocr/issues/detail?id=757
“The build fails as sem_init is in librt on Solaris. The attached patch adds searching for sem_init in librt. After that the build succeeds.”
Search librt in the libraries:
/usr/lib/x86_64-linux-gnu/
librt.a
librt.so
So I include /usr/lib/x86_64-linux-gnu into the Library Paths
Include rt into Libraries.
Rebuild the project with hope....
Again, the same compiling errors are:
svutil.cpp:129: undefined reference to `sem_init'
svutil.cpp:137: undefined reference to `sem_post'
svutil.cpp:145: undefined reference to `sem_wait'
svutil.cpp:188: undefined reference to `pthread_create'
I guess I need to include some header files. But I failed to find one.
Or do I have to learn autotool to achieve what I want?
An easy way?
Hmm, why you are trying to use tesseract within Ellipse (personally I found to work with eclipse more difficult than other solutions, but it could be my problem) if you have no clue about standard compiler errors ;-)?
That error means that linker is missing library that provide sem_init, sem_post, sem_wait, pthread_create on YOUR system (copying from other system does not always work).
--
Zdenko
Then what should I use?
I am in Ubuntu. The available and popular C++ IDE is Eclipse.
And since I want to go to the dubugging mode for tesseractmain.cpp (I want to look into the ocr code), it is better to use a IDE. It would be appreciated if you advice more easier options.
I did not copy the missing library. The librt is in the computer. I just include the library path and file in the project properties. But it still complains, so I think I need to find and include the corresponding header.
What is the header file for librt?
Thanks.
I want to build the tesseract 3.02.02 project so that I can modify some code to tune it to some specific task.
Version: tesseract 3.02.02
Ubuntu 12.04, Eclipse Juno
I put the tesseract into the Eclipse project.
Include directories
/usr/local/include
/usr/local
/usr/include/leptonica
and all file directories of the tesseract source, e.g. /Tesseract302Test/src/api, etc.
Library Paths:
/usr/local/lib
Libraries
/lept
Then I build the project.
The error pops out:
../src/training/classifier_tester.cpp:20:35: fatal error: base/commandlineflags.h: No such file or directory
compilation terminated.
There is no such commandlineflags.h file.
How can I solve this problem?