tesseract-ocr / tessdoc

Tesseract documentation
https://tesseract-ocr.github.io/tessdoc/
1.84k stars 363 forks source link

Error on install #56

Closed ChristoforosKor closed 3 years ago

ChristoforosKor commented 3 years ago

Hello ,

I am trying to install tesseract-ocr on Debian 9 with gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516.

I run with the below order, according to this https://github.com/tesseract-ocr/tessdoc/blob/master/Compiling-%E2%80%93-GitInstallation.md ./autogen.sh ./configure make

Now when I run make I get the following error:

root@genius1062:/usr/local/tesseract# make Making all in . make[1]: Entering directory '/usr/local/tesseract' CXX src/api/libtesseract_la-baseapi.lo In file included from ./src/ccutil/elst.h:24:0, from ./src/ccstruct/points.h:22, from ./src/ccstruct/rect.h:22, from ./src/ccstruct/boxword.h:22, from src/api/baseapi.cpp:26: ./src/ccutil/serialis.h: In member function ‘bool tesseract::TFile::DeSerialize(std::vector&)’: ./src/ccutil/serialis.h:107:17: error: expected primary-expression before ‘constexpr’ } else if ( constexpr (std::is_same_v<T, std::string>)) { ^~~~~ ./src/ccutil/serialis.h:107:17: error: expected ‘)’ before ‘constexpr’ ./src/ccutil/serialis.h:116:15: error: expected ‘(’ before ‘constexpr’ } else if constexpr (std::is_class_v) { ^~~~~ ./src/ccutil/serialis.h:151:3: error: expected ‘}’ at end of input } ^ ./src/ccutil/serialis.h: In member function ‘bool tesseract::TFile::Serialize(const std::vector&)’: ./src/ccutil/serialis.h:166:15: error: expected ‘(’ before ‘constexpr’ } else if constexpr (std::is_same_v<T, std::string>) { ^~~~~ ./src/ccutil/serialis.h:198:3: error: expected ‘}’ at end of input } ^ In file included from ./src/ccutil/genericvector.h:22:0, from ./src/ccstruct/fontinfo.h:25, from ./src/ccstruct/ratngs.h:29, from ./src/dict/dawg.h:33, from ./src/dict/dawg_cache.h:23, from src/api/baseapi.cpp:28: ./src/ccutil/helpers.h: In function ‘bool tesseract::Serialize(FILE*, const std::vector&)’: ./src/ccutil/helpers.h:252:13: error: expected ‘(’ before ‘constexpr’ } else if constexpr (std::is_class_v) { ^~~~~ src/api/baseapi.cpp:2380:1: error: expected ‘}’ at end of input } // namespace tesseract ^ src/api/baseapi.cpp: At global scope: src/api/baseapi.cpp:2380:1: error: expected ‘}’ at end of input Makefile:4696: recipe for target 'src/api/libtesseract_la-baseapi.lo' failed make[1]: [src/api/libtesseract_la-baseapi.lo] Error 1 make[1]: Leaving directory '/usr/local/tesseract' Makefile:7801: recipe for target 'all-recursive' failed make: [all-recursive] Error 1

ChristoforosKor commented 3 years ago

Sorry a few lines after the docs https://github.com/tesseract-ocr/tessdoc/blob/master/Compiling-%E2%80%93-GitInstallation.md

have the solution:

make all-recursive Making all in ccstruct /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. - I.. -I../ccutil -I../cutil -I../image -I../viewer -I/opt/local/ include -I/usr/local/include/leptonica -g -O2 -MT blobbox.lo -MD -MP - MF .deps/blobbox.Tpo -c -o blobbox.lo blobbox.cpp mv -f .deps/blobbox.Tpo .deps/blobbox.Plo mv: rename .deps/blobbox.Tpo to .deps/blobbox.Plo: No such file or directory make[3]: [blobbox.lo] Error 1 make[2]: [all-recursive] Error 1 make[1]: [all-recursive] Error 1 make: [all] Error 2

ChristoforosKor commented 3 years ago

Sorry to reopen the issue but it persist even if I try the suggestions on the above reply.

stweil commented 3 years ago

I am trying to install tesseract-ocr on Debian 10 with gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516.

That looks like your compiler is still from Debian 9. Compilation with gcc-6 requires some small modifications of the code.

stweil commented 3 years ago

If you really have Debian 10 ("buster"), I suggest to update your compiler to that version.

ChristoforosKor commented 3 years ago

Sorry, my mistake I have debian 9. What are the modifications I have to make?

ChristoforosKor commented 3 years ago

My mistake. I have Debian 9.

Στις Σάβ, 11 Σεπ 2021, 23:59 ο χρήστης Stefan Weil @.***> έγραψε:

If you really have Debian 10 ("buster"), I suggest to update your compiler to that version.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/tesseract-ocr/tessdoc/issues/56#issuecomment-917479196, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEXDUOBZ2HGRMHTSGKN5J3UBO7LDANCNFSM5D3JS4RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChristoforosKor commented 3 years ago

I uprgaded my system to Debian 10 and my gcc version is 6.3.0. I am still getting this error when I run make:

 Entering directory '/usr/local/tesseract'
  CXX      src/api/tesseract-tesseractmain.o
In file included from ./src/ccutil/elst.h:24:0,
                 from ./src/ccutil/ambigs.h:30,
                 from ./src/dict/dict.h:27,
                 from src/api/tesseractmain.cpp:34:
./src/ccutil/serialis.h: In member function ‘bool tesseract::TFile::DeSerialize(std::vector<T>&)’:
./src/ccutil/serialis.h:107:16: error: expected ‘(’ before ‘constexpr’
     } else if  constexpr (std::is_same_v<T, std::string>) {
                ^~~~~~~~~
./src/ccutil/serialis.h:151:3: error: expected ‘}’ at end of input
   }
   ^
./src/ccutil/serialis.h: In member function ‘bool tesseract::TFile::Serialize(const std::vector<T>&)’:
./src/ccutil/serialis.h:166:15: error: expected ‘(’ before ‘constexpr’
     } else if constexpr (std::is_same_v<T, std::string>) {
               ^~~~~~~~~
./src/ccutil/serialis.h:198:3: error: expected ‘}’ at end of input
   }
   ^
In file included from ./src/ccutil/unicharset.h:26:0,
                 from ./src/ccutil/ambigs.h:32,
                 from ./src/dict/dict.h:27,
                 from src/api/tesseractmain.cpp:34:
./src/ccutil/helpers.h: In function ‘bool tesseract::Serialize(FILE*, const std::vector<T>&)’:
./src/ccutil/helpers.h:252:13: error: expected ‘(’ before ‘constexpr’
   } else if constexpr (std::is_class_v<T>) {
             ^~~~~~~~~
src/api/tesseractmain.cpp:816:1: error: expected ‘}’ at end of input
 }
 ^
src/api/tesseractmain.cpp: At global scope:
src/api/tesseractmain.cpp:816:1: error: expected ‘}’ at end of input
make[1]: *** [Makefile:7768: src/api/tesseract-tesseractmain.o] Error 1
make[1]: Leaving directory '/usr/local/tesseract'
make: *** [Makefile:8150: all-recursive] Error 1
ChristoforosKor commented 3 years ago

It seems that although my system updated to Debian 10 my gcc compiler remained on 6.3 version. I updates gcc seperetaly to 8.3 and ti workd fine