Is it possible to compile Tesseract ORC as pure C without linking the C++ standard lib?
I compiled Tesseract following the instructions here, which worked fine. But when I linked it with the sample c program from the docs, it gave me the following errors:
"std::__1::basic_streambuf<char, std::__1::char_traits<char> >::~basic_streambuf()", referenced from:
std::__1::basic_filebuf<char, std::__1::char_traits<char> >::~basic_filebuf() in libtesseract.a(libtesseract_api_la-baseapi.o)
std::__1::basic_filebuf<char, std::__1::char_traits<char> >::basic_filebuf() in libtesseract.a(libtesseract_api_la-baseapi.o)
"std::__1::cin", referenced from:
tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*) in libtesseract.a(libtesseract_api_la-baseapi.o)
Obviously it's trying to link the C++ standard library. Is it possible to compile as pure c, without the C++ standard lib? I want to eventually cross compile for arm-7 without standard lib support.
Here is my makefile (And no, the answer is not turn gcc to g++. I want to compile as c):
CFLAGS = -c -Wall -I../src/api/ -I../src/ccstruct -I../src/ccutil -I../leptonica/src/ -I../leptonica/build/src
default: main
main.o: main.c
gcc $(CFLAGS) -c main.c -o main.o
main: main.o
gcc main.o ../leptonica/lib/nodebug/liblept.a ../src/api/.libs/libtesseract.a -o main
clean:
-rm -f *.o
-rm -f main