make 过程中安装时的 Tesseract 问题

Tesseract problem on installation during make

我正在尝试使用 gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 在 Debian 9 上安装 tesseract-ocr。

我运行按照下面的顺序,按照这个https://github.com/tesseract-ocr/tessdoc/blob/master/Compiling-%E2%80%93-GitInstallation.md

./autogen.sh 。/配置 制作

现在,当我 运行 make 时,出现以下错误:

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

我已经尝试了 id 应该解决这个问题的 popst 安装指令,但没有成功

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`enter code here`

感谢任何帮助。

升级你的编译器——当前的 tesseract 需要一个支持 c++17 的现代编译器。