I have a strange problem linking c++ with Leptonica. Normal function invocation works fine, but I need functions from the library which were originally not exposed in the .so library. So I have searched for the two interesting functions in the source, removed the static keyword, so they look similar to exposed ones. I have remade the full library after a make clean. The .so file looks OK:
nm liblept.so.5.0.0 ... 000000000009d010 T dewarpGetMeanVerticals 000000000009d160 T dewarpGetTextlineCenters 000000000009d8f0 T dewarpIsLineCoverageValid
Compiling to .o file and observing it:
g++ -c -std=c++11 -I../leptonica/src/src/ preproc.cpp -L../leptonica/src/.libs/ -llept -o preproc nm preproc ... U dewarpGetMeanVerticals U dewarpIsLineCoverageValid
While the same compiling without -c flag results in
/tmp/ccCPqS1R.o: In function `_dewarpGetTextlineCenters(Pix*, int)': preproc.cpp:(.text+0x3d5): undefined reference to `dewarpGetMeanVerticals' /tmp/ccCPqS1R.o: In function `_dewarpBuildPageModel(L_Dewarp*, char const*)': preproc.cpp:(.text+0x81d): undefined reference to `dewarpIsLineCoverageValid' collect2: error: ld returned 1 exit status
What do I do wrong?
Thank you in advance: Balázs