在Visual Studio 2017年的Tesseract 3.05生成错误(Tesseract

2019-09-29 23:46发布

我用提供的解决方案在这里 ,以便使我的windows10 64项目3.05的Tesseract工作时,Visual Studio 2017年建立时,我得到了这些错误:

    11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C3646: 'UTF32ToUTF8': unknown override specifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\genericvector.h(376): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\params.h(205): warning C4800: 'BOOL8': forcing value to bool 'true' or 'false' (performance warning)
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C3646: 'CleanupString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C3646: 'CleanupString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2065: 'string': undeclared identifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2146: syntax error: missing ';' before identifier 'cleaned'
11>c:\users\ mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2065: 'cleaned': undeclared identifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C3861: 'CleanupString': identifier not found
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(266): error C2065: 'cleaned': undeclared identifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C3646: 'VersionString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C2059: syntax error: '('
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(183): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(183): error C2143: syntax error: missing ',' before '&'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(134): error C2664: 'void tesseract::TessdataManager::SetVersionString(const int)': cannot convert argument 1 from 'const char [13]' to 'const int'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(134): note: There is no context in which this conversion is possible
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(138): error C2664: 'void tesseract::TessdataManager::SetVersionString(const int)': cannot convert argument 1 from 'const char [13]' to 'const int'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(138): note: There is no context in which this conversion is possible
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\dict\dict.h(55): warning C4566: character represented by universal-character-name '\u2606' cannot be represented in the current code page (1252)
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\api\tesseractmain.cpp(34): fatal error C1083: Cannot open include file: 'simddetect.h': No such file or directory
11>Done building project "tesseract.vcxproj" -- FAILED.
========== Build: 9 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

如何解决这些问题?

Answer 1:

由于链接的答案的时候,项目的结构改变。 它更新到3.05的Tesseract和明确的Git的子模块链接到正确的Leptonicatesseract_3.05来源补充。

看起来你已经下载了主来源为他们两个。 目前VS2015_Tesseract与其不兼容。

适当的依赖链接: leptonica @ e98a794tesseract_3.05 @ 7fe95f0 。 下载并尝试重新生成解决方案。



Answer 2:

C / C ++加入后- >附加包含库

C:\Users\Jihed Mestiri\Documents\VS2015_Tesseract-master\liblept
C:\Documents\VS2015_Tesseract-master\leptonica\src
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\wordrec
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\opencl
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\viewer
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\textord
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\neural_networks\runtime
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\dict
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\cutil
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\cube
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\classify
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccstruct
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccutil
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccmain
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\api
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\vs2010\port

以及包含.lib文件中链接的目录- >常规- >附加库directorie S和包含在链接器- >输入- >附加依赖正方体和Leptonica这些.lib文件:

libtesseract.lib
giflib.lib
libjpeg.lib
liblept.lib
libpng.l‌​ib
libtiff.lib
li‌​bwe‌​bp.lib
openjpeg.lib
‌​zlib.lib

我的编译错误的测试程序改为:

1>------ Build started: Project: RedEyeRemover, Configuration: Debug x64 ------
1>LINK : fatal error LNK1104: cannot open file 'libpng.l‌​ib'
1>Done building project "RedEyeRemover.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

而包含libpng.lib文件的目录被包含在连接器- >常规

该参数是从正方体/ tesseract.vcxproj拍摄,我从建VS2015_Tesseract

什么都可以是错误背后的原因是什么? 是有办法来验证tesseract.vcxproj在自己的正常工作? 因为我得到的错误,当我太编译它的Visual Studio 2017年在x64目标(使用V140 = VS 2015年版的版本)。

编辑: :我发现这个问题是在链接器- >常规- >附加库目录,在那里我的路径例如父目录的一个有一个空格 :“XXX XXX /正方体”。 =>避免使用具有空间路径。



文章来源: Tesseract 3.05 Build errors in Visual Studio 2017