tesseract-ocr / tesseract

Tesseract Open Source OCR Engine (main repository)
https://tesseract-ocr.github.io/
Apache License 2.0
61.26k stars 9.41k forks source link

Build Tesseract from source with Visual Studio #2876

Closed essamzaky closed 3 years ago

essamzaky commented 4 years ago

Environment

Current Behavior:

I can not build from source i had download SW client and save it at "D:\Essam\Software\SW" the add to Path and i can run SW in command line and see WS information as follow D:\Tutorial\Git\tesseract\build>sw --version sw.client.sw version 1.0.0 git revision 083bb99144549c1f361298e8284daa6b54422965 assembled on 30.01.2020 18:36:29 Egypt Standard Time

then i run the following commands to compile from source as describe in the following link https://github.com/tesseract-ocr/tesseract/wiki/Compiling the command are

git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst

i receive the following error

"-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363. Configuring tesseract version 5.0.0-alpha-621-ga1a17... -- target changed from "auto" to "kaby-lake" CMake Error at CMakeLists.txt:197 (find_package): By not providing "FindSW.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SW", but CMake did not find one.

Could not find a package configuration file provided by "SW" with any of the following names:

SWConfig.cmake
sw-config.cmake

Add the installation prefix of "SW" to CMAKE_PREFIX_PATH or set "SW_DIR" to a directory containing one of the above files. If "SW" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "D:/Tutorial/Git/tesseract/build/CMakeFiles/CMakeOutput.log"."

the log file attached

CMakeOutput.log

Expected Behavior:

build tesseract solution

Suggested Fix:

Moldoteck commented 4 years ago

did you do : sw setup ?

essamzaky commented 4 years ago

i did sw setup and repeated the steps i still getting error as follow command failed: exit code = 1120 (0x460) sw command: D:/Essam/Software/SW/sw.exe -shared -platform x64 -d D:/Tutorial/Git/tesseract/build/.sw/cmake integrate -cmake-deps D:/Tutorial/Git/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/essam.elkoshairy/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute)

baishuangcheng commented 4 years ago

I have the same mistake. After executing SW setup (at sw directory)and executing again cmake .. , the problem is solved.

baishuangcheng commented 4 years ago

I'm getting error as follow too: Unpacking : [org.sw.demo.gnu.grep.gnulib-3.4.0]/[Source Archive] Exception in file D:/dev/cppan2/client2/src/sw/manager/storage.cpp:438, function get: Error downloading file for package: org.sw.demo.python.exe-3.8.1, file: Source Archive sw command: D:/OnonDev/sw.exe -shared -platform x86 -d D:/OnonDev/tesstutorial/tesseract/build/.sw/cmake integrate -cmake-deps D:/OnonDev/tesstutorial/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/33186/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute)

essamzaky commented 4 years ago

may be there are cashed files from SW , if someone know how to clear SW cashed files from previous trials or if someone know other solution please tell us

Shreeshrii commented 4 years ago

Appeyor build seems to use sw and is working. Check out the logs at https://ci.appveyor.com/project/zdenop/tesseract/build/job/c5l28ht5hq3x478q

essamzaky commented 4 years ago

Sorry i do not know Appeyor , how i use it to generate Tesseract binaries , libs and headers , if there is any tutorial to use it please mention it

Shreeshrii commented 4 years ago

Appeyor is used for continuous integration for Tesseract - it automatically rebuilds tesseract after every commit (or however it is configured).

https://ci.appveyor.com/project/zdenop/tesseract/build/job/c5l28ht5hq3x478q/artifacts has a zip file with all binaries and dlls from that build.

Shreeshrii commented 4 years ago

https://ci.appveyor.com/project/zdenop/tesseract/build/job/66l95n7ofxrs0xtf/artifacts Environment: APPVEYOR_BUILD_WORKER_IMAGE=Visual Studio 2017, platform=Win64

essamzaky commented 4 years ago

thanks @Shreeshrii i dwonloaded the following build https://ci.appveyor.com/project/zdenop/tesseract/build/job/66l95n7ofxrs0xtf/artifacts Environment: APPVEYOR_BUILD_WORKER_IMAGE=Visual Studio 2017, platform=Win64

But i found only the binaries , where i can find the hedears,lib and cmake folder , i'm trying to build OpenCV + Tesseract , Opencv needs tesseract headers , lib and cmake folder

i did this before by building tesseract on my machine and build install project which create all required folders and files install folder contain the following folders (bin,cmake,include, and lib )

how i can get the required folders and files from Appeyor build version

zdenop commented 4 years ago

If you try to build OpenCV + Tesseract, then try to follow blog Building tesseract and leptonica with CMake and Clang on Windows - you do not need most of tesseract dependencies / or you already build it as OpenCV.

essamzaky commented 4 years ago

I succeed to build Tesseract from source by doing the following 1-Clear the cashed files by SW from old trials you can find the files in "C:\Users\yourUserName\.sw" 2-Delete the old cloned tesseract 3-install latest SW client and add it to path 4-Open command line cmd and run as administrator --> not mentioned in wiki 5-in cmd run sw setup --> not mentioned in wiki 6-change directory where you want clone tesseract source cd D:\Tutorial\Git 7-clone tesseract and build tesseract git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst 8-Open the tesseract solution you will find it in ""D:\Tutorial\Git\tesseract\build\tesseract.sln"" 9-Build the solution in VS Note Debug version succeded Release version failed due to adding some debug libraries in Release the debug libraries are concrtd.lib msvcprtd.lib vcruntimed.lib msvcrtd.lib ucrtd.lib Change them to release by removing the letter "d" concrt.lib msvcprt.lib vcruntime.lib msvcrt.lib ucrt.lib then the Release version will build successfully

Also succeded to build OpenCV with Tesseract

essamzaky commented 4 years ago

If you try to build OpenCV + Tesseract, then try to follow blog Building tesseract and leptonica with CMake and Clang on Windows - you do not need most of tesseract dependencies / or you already build it as OpenCV.

Thanks @zdenop i will try this plog , actually a followed many tutorials but failed to build latest tesseract + OpenCV

baishuangcheng commented 4 years ago

@essamzaky I try your plog,but get this error:

D:\OnonDev\tesstutorial\libsrc\zlib-1.2.11\build.clang>set CC=clang-cl

D:\OnonDev\tesstutorial\libsrc\zlib-1.2.11\build.clang>set CXX=clang-cl

D:\OnonDev\tesstutorial\libsrc\zlib-1.2.11\build.clang>cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=Release
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.12/Modules/CMakeDetermineCCompiler.cmake:48 (message):
  Could not find compiler set in environment variable CC:

  clang-cl.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "D:/OnonDev/tesstutorial/libsrc/zlib-1.2.11/build.clang/CMakeFiles/CMakeOutput.log".
baishuangcheng commented 4 years ago

copy C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\ClangC2\14.10.25903\bin\HostX64\clang.exe and rename to clang-cl.exe it is work.

zdenop commented 4 years ago

set CC=clang should be sufficient. But it is stupid that they used name clang.exe (gcc compatibility mode) instead of clang-cl.exe (VS compatibility mode)

korhun commented 4 years ago

I succeed to build Tesseract from source by doing the following 1-Clear the cashed files by SW from old trials you can find the files in "C:\Users\yourUserName.sw" 2-Delete the old cloned tesseract 3-install latest SW client and add it to path 4-Open command line cmd and run as administrator --> not mentioned in wiki 5-in cmd run sw setup --> not mentioned in wiki 6-change directory where you want clone tesseract source cd D:\Tutorial\Git 7-clone tesseract and build tesseract git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst 8-Open the tesseract solution you will find it in ""D:\Tutorial\Git\tesseract\build\tesseract.sln"" 9-Build the solution in VS Note Debug version succeded Release version failed due to adding some debug libraries in Release the debug libraries are concrtd.lib msvcprtd.lib vcruntimed.lib msvcrtd.lib ucrtd.lib Change them to release by removing the letter "d" concrt.lib msvcprt.lib vcruntime.lib msvcrt.lib ucrt.lib then the Release version will build successfully

Also succeded to build OpenCV with Tesseract

@essamzaky this information you have provided saved a lot of time :) thank you very much...

For Visual Studio 2019 this works: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=inst

essamzaky commented 4 years ago

I succeed to build Tesseract from source by doing the following 1-Clear the cashed files by SW from old trials you can find the files in "C:\Users\yourUserName.sw" 2-Delete the old cloned tesseract 3-install latest SW client and add it to path 4-Open command line cmd and run as administrator --> not mentioned in wiki 5-in cmd run sw setup --> not mentioned in wiki 6-change directory where you want clone tesseract source cd D:\Tutorial\Git 7-clone tesseract and build tesseract git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst 8-Open the tesseract solution you will find it in ""D:\Tutorial\Git\tesseract\build\tesseract.sln"" 9-Build the solution in VS Note Debug version succeded Release version failed due to adding some debug libraries in Release the debug libraries are concrtd.lib msvcprtd.lib vcruntimed.lib msvcrtd.lib ucrtd.lib Change them to release by removing the letter "d" concrt.lib msvcprt.lib vcruntime.lib msvcrt.lib ucrt.lib then the Release version will build successfully Also succeded to build OpenCV with Tesseract

@essamzaky this information you have provided saved a lot of time :) thank you very much...

For Visual Studio 2019 this works: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=inst

Good to know it helped you :) , Building Tesseract + Opencv in windows was like nightmare for me , from 4 month ago it took 2 weeks from me without any success , someone from Opencv contributors helped me with some workarounds , anyway good luck.

essamzaky commented 4 years ago

Hints about cloning and install paths it's seems cmake cannot process the *.cmake file generated by tesseract correctly see the following issue #2883 1-use small letters in the cloning path , and install path i.e "D:\Tesseract" for cloning may cause problem replace it by "d:\tesseract" , '\T' is the reason 2-do not use special characters in the cloning path i.e "d:\my tesseract " my cause problem so replace it by "d:\mytess" space my be the source of error 3-do not use very long folders names i.e "d:\My Tesseract Build" do not exceed 8 characters replace it by "d:\mytess"

moni179 commented 4 years ago

I succeed to build Tesseract from source by doing the following 1-Clear the cashed files by SW from old trials you can find the files in "C:\Users\yourUserName.sw" 2-Delete the old cloned tesseract 3-install latest SW client and add it to path 4-Open command line cmd and run as administrator --> not mentioned in wiki 5-in cmd run sw setup --> not mentioned in wiki 6-change directory where you want clone tesseract source cd D:\Tutorial\Git 7-clone tesseract and build tesseract git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst 8-Open the tesseract solution you will find it in ""D:\Tutorial\Git\tesseract\build\tesseract.sln"" 9-Build the solution in VS Note Debug version succeded Release version failed due to adding some debug libraries in Release the debug libraries are concrtd.lib msvcprtd.lib vcruntimed.lib msvcrtd.lib ucrtd.lib Change them to release by removing the letter "d" concrt.lib msvcprt.lib vcruntime.lib msvcrt.lib ucrt.lib then the Release version will build successfully

Also succeded to build OpenCV with Tesseract @essamzaky I followed this instructions like 4 times and i still having the same error that you had: command failed: exit code = 1120 (0x460) sw command: D:/Essam/Software/SW/sw.exe -shared -platform x64 -d D:/Tutorial/Git/tesseract/build/.sw/cmake integrate -cmake-deps D:/Tutorial/Git/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/essam.elkoshairy/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute) Any idea?

essamzaky commented 4 years ago

I succeed to build Tesseract from source by doing the following 1-Clear the cashed files by SW from old trials you can find the files in "C:\Users\yourUserName.sw" 2-Delete the old cloned tesseract 3-install latest SW client and add it to path 4-Open command line cmd and run as administrator --> not mentioned in wiki 5-in cmd run sw setup --> not mentioned in wiki 6-change directory where you want clone tesseract source cd D:\Tutorial\Git 7-clone tesseract and build tesseract git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst 8-Open the tesseract solution you will find it in ""D:\Tutorial\Git\tesseract\build\tesseract.sln"" 9-Build the solution in VS Note Debug version succeded Release version failed due to adding some debug libraries in Release the debug libraries are concrtd.lib msvcprtd.lib vcruntimed.lib msvcrtd.lib ucrtd.lib Change them to release by removing the letter "d" concrt.lib msvcprt.lib vcruntime.lib msvcrt.lib ucrt.lib then the Release version will build successfully Also succeded to build OpenCV with Tesseract @essamzaky I followed this instructions like 4 times and i still having the same error that you had: command failed: exit code = 1120 (0x460) sw command: D:/Essam/Software/SW/sw.exe -shared -platform x64 -d D:/Tutorial/Git/tesseract/build/.sw/cmake integrate -cmake-deps D:/Tutorial/Git/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/essam.elkoshairy/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute) Any idea?

@moni179 try to post the error in your machine , and if you can attach log file may be this leads to discover the error

moni179 commented 4 years ago

@essamzaky This is the error: Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:592, function execute1: When executing: D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.dll Creando biblioteca D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.lib y objeto D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.exp sw.cpp.a2a6fd.8626daaf.obj : error LNK2001: sÝmbolo externo "protected: virtual bool cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.e466861e.obj : error LNK2001: sÝmbolo externo "protected: virtual bool __cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.b2799dc2.obj : error LNK2001: sÝmbolo externo "protected: virtual bool cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.a02e449b.obj : error LNK2001: sÝmbolo externo "protected: virtual bool __cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver D:\tutorialgit\tesseract\build.sw\cmake.sw\cfg\162151\loc.sw.self.b2da42-local.dll : fatal error LNK1120: 1 externos sin resolver command failed: exit code = 1120 (0x460) sw command: C:/Program Files/Tesseract-OCR/sw.exe -shared -platform x64 -d D:/tutorialgit/tesseract/build/.sw/cmake integrate -cmake-deps D:/tutorialgit/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/monil/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute)

-- Configuring incomplete, errors occurred! See also "D:/tutorialgit/tesseract/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

essamzaky commented 4 years ago

@essamzaky This is the error: Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:592, function execute1: When executing: D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.dll Creando biblioteca D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.lib y objeto D:/tutorialgit/tesseract/build/.sw/cmake/.sw/cfg/162151/loc.sw.self.b2da42-local.exp sw.cpp.a2a6fd.8626daaf.obj : error LNK2001: sÝmbolo externo "protected: virtual bool cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.e466861e.obj : error LNK2001: sÝmbolo externo "protected: virtual bool __cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.b2799dc2.obj : error LNK2001: sÝmbolo externo "protected: virtual bool cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver sw.cpp.a2a6fd.a02e449b.obj : error LNK2001: sÝmbolo externo "protected: virtual bool __cdecl sw::NativeCompiledTarget::isStaticLibrary(void)const " (?isStaticLibrary@NativeCompiledTarget@sw@@MEBA_NXZ) sin resolver D:\tutorialgit\tesseract\build.sw\cmake.sw\cfg\162151\loc.sw.self.b2da42-local.dll : fatal error LNK1120: 1 externos sin resolver command failed: exit code = 1120 (0x460) sw command: C:/Program Files/Tesseract-OCR/sw.exe -shared -platform x64 -d D:/tutorialgit/tesseract/build/.sw/cmake integrate -cmake-deps D:/tutorialgit/tesseract/build/.sw/cmake/sw.txt CMake Error at C:/Users/monil/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:213 (sw_execute)

-- Configuring incomplete, errors occurred! See also "D:/tutorialgit/tesseract/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

Hi @egorpugin do you know the reason for the described error

egorpugin commented 4 years ago

Hi,

@essamzaky Try to run sw --self-upgrade then sw setup and re-run cmake. There are lots of messages here, please point me at specific issues, so I could help.

As for opencv+tess - check out this example using sw (main file is near to cmake lists) https://github.com/SoftwareNetwork/sw/blob/master/test/integrations/cmake/tess/CMakeLists.txt

essamzaky commented 4 years ago

@moni179 describe the steps you applied and the error details then link egorpugin to the post he will help you

jasnei commented 4 years ago

@essamzaky @egorpugin I tried many many times as you post. I tried many days, again & again. But I still got these Error, fail to debug.

Here is the Error. glib-enumtypes.h is not in the directory, but there is glib-enumtypes.h.template. I had chang it to glib-enumtypes.h, but still not ok. Could anyone help me out? Thank you.

Error MSB6006 “cmd.exe”exit,code 1. BUILD_DEPENDENCIES C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets
Error LNK1104 Cannot open file“C:\Users\Administrator.sw\storage\pkg\75\6a\600e\obj\bld\471767\lib\org.sw.demo.danbloomberg.leptonica-1.80.0.lib” libtesseract D:\gittess\tesseract2\build D:\gittess\tesseract2\build\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” ambiguous_words D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” combine_tessdata D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” dawg2wordlist D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” classifier_tester D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” cntraining D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” combine_lang_model D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” lstmeval D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” mftraining D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” lstmtraining D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” set_unicharset_properties D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error C1083 Unable to open include file: “gobject/glib-enumtypes.h”: No such file or directory (Compile source file D:\gittess\tesseract2\src\training\text2image.cpp) text2image C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib\glib-object.h
Error LNK1104 Cannot open file“Debug\tesseract50d.lib” tesseract D:\gittess\tesseract2\build D:\gittess\tesseract2\build\LINK
Error C1083 Unable to open include file: “gobject/glib-enumtypes.h”: No such file or directory (Compile source file D:\gittess\tesseract2\src\training\ligature_table.cpp) text2image C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib\glib-object.h
Error C1083 Unable to open include file: “gobject/glib-enumtypes.h”: No such file or directory (Compile source file D:\gittess\tesseract2\src\training\pango_font_info.cpp) text2image C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib\glib-object.h
Error C1083 Unable to open include file: “gobject/glib-enumtypes.h”: No such file or directory (Compile source file D:\gittess\tesseract2\src\training\stringrenderer.cpp) text2image C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib C:\Users\Administrator.sw\storage\pkg\b8\f1\524a\src\sdir\glib\glib-object.h
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” unicharset_extractor D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
Error LNK1104 Cannot open file“....\Debug\tesseract50d.lib” wordlist2dawg D:\gittess\tesseract2\build\src\training D:\gittess\tesseract2\build\src\training\LINK
egorpugin commented 4 years ago

@jasnei Please, provide more info. How do you invoke build? What do you do? What do you want? Use tesseract in your application?

jasnei commented 4 years ago

@egorpugin

Environment

What I did

What I want I want use tesseract for OpenCV.

Thanks

egorpugin commented 4 years ago

I want use tesseract for OpenCV.

What does it mean?

jasnei commented 4 years ago

@egorpugin

What I mean I'm using OpenCV with vs2017, I would like to build tesseract so that I can use it in vs2017.

egorpugin commented 4 years ago

Do you use cmake to generate VS solution?

jasnei commented 4 years ago

Yes cmake to generate VS solutions. Cmake 3.17.0-rc1

egorpugin commented 4 years ago

And you cannot add tesseract dependecy as it is shown here? https://github.com/SoftwareNetwork/sw/blob/master/test/integrations/cmake/tess/CMakeLists.txt

jasnei commented 4 years ago

I use the cmakelist.txt, you refer,

got error

sw command: D:/SW/sw.exe -shared -platform x64 -d D:/gittess/tesseract4/build/.sw/cmake integrate -cmake-deps D:/gittess/tesseract4/build/.sw/cmake/sw.txt CMake Error at C:/Users/Administrator/.sw/storage/etc/sw/static/SWConfig.cmake:121 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:16 (sw_execute)

CMakeCache.txt

egorpugin commented 4 years ago

I mean use that example for YOUR cmake project, not to build tess itself.

jasnei commented 4 years ago

yes, I did, U used the cmake project. but not work thanks

keyxuliang commented 4 years ago

image What's the reasons?

egorpugin commented 4 years ago

Check sw --version, post it here. Try sw --self-upgrade and re-run.

gregko commented 4 years ago

For Visual Studio 2019 this works: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=inst

I installed Visual Studio 2019 Community Edition, but it does not work. I get this error:

C:\github\tesseract\build>cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=inst CMake Error: Could not create named generator Visual Studio 16 2019

Generators Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64". Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be "Win64" or "IA64". Borland Makefiles = Generates Borland makefiles. NMake Makefiles = Generates NMake makefiles. NMake Makefiles JOM = Generates JOM makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). MSYS Makefiles = Generates MSYS makefiles. MinGW Makefiles = Generates a make file for use with mingw32-make. Unix Makefiles = Generates standard UNIX makefiles. Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files. CodeBlocks - NMake Makefiles = Generates CodeBlocks project files. CodeBlocks - NMake Makefiles JOM = Generates CodeBlocks project files. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - MinGW Makefiles = Generates CodeLite project files. CodeLite - NMake Makefiles = Generates CodeLite project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - MinGW Makefiles = Generates Sublime Text 2 project files. Sublime Text 2 - NMake Makefiles = Generates Sublime Text 2 project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - MinGW Makefiles = Generates Kate project files. Kate - NMake Makefiles = Generates Kate project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - NMake Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - MinGW Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

zdenop commented 4 years ago

@gregko : That message means that your cmake installation does not recognizes your VS20019 installation. That problem is not related to tesseract. Try to upgrade/reinstall cmake.

gregko commented 4 years ago

Thank you, @zdenop, this is very helpful. I updated cmake now.

Greg

mokserpent commented 4 years ago

I got an error message as below after followed @essamzaky commented

Performing 15 check(s): org.sw.demo.gnu.iconv.libiconv-1.16.0 (libiconv), config 181853 Performing 2 check(s): org.sw.demo.expat-2.2.9 (expat), config 181853 Exception in file D:/dev/cppan2/client2/src/sw/driver/target/native.cpp:1625, function findSources: No bazel file found in SourceDir: C:/Users/mokse/.sw/storage/pkg/6c/65/db43/src/sdir sw command: D:/sw-master-windows-client/sw.exe -shared -platform x64 -compiler msvc-19.14 -d D:/tesseract/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/tesseract/build/.sw/cmake/sw.txt -cmake-file-version 4 CMake Error at C:/Users/mokse/.sw/storage/etc/sw/static/SWConfig.cmake:232 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:318 (sw_execute)

but in my computer, there is no D:/dev/.... directory .. anyone could help, plz.

egorpugin commented 4 years ago

Hi,

Please update sw binary from the website or using sw --self-upgrade.

mokserpent commented 4 years ago

Hi,

Please update sw binary from the website or using sw --self-upgrade.

Thanks @egorpugin I did it , but still the same result...

egorpugin commented 4 years ago

Post sw --version output.

mokserpent commented 4 years ago

@egorpugin

D:\Tesseract\tesseract\build>sw --version sw.client.sw version 1.0.0 git revision 2dfdca90d71b36482e3b31f4179c06a6f91dba18 assembled on 08.08.2020 17:12:10 UTC 09.08.2020 01:12:10 x_зǮɶ

I run the compiling in another pc, but got the other error messages as below

D:\Tesseract\tesseract\build>cmake .. -- Building for: Visual Studio 15 2017 -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363. -- The C compiler identification is MSVC 19.16.27032.1 -- The CXX compiler identification is MSVC 19.16.27032.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done Configuring tesseract version 5.0.0-alpha-773-gd33ed... -- Setting build type to 'Release' as none was specified. -- IPO / LTO supported -- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE -- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE - Failed -- Performing Test HAVE_AVX -- Performing Test HAVE_AVX - Failed -- Performing Test HAVE_AVX2 -- Performing Test HAVE_AVX2 - Failed -- Performing Test HAVE_FMA -- Performing Test HAVE_FMA - Failed -- Performing Test HAVE_SSE4_1 -- Performing Test HAVE_SSE4_1 - Failed -- Performing Test HAVE_NEON -- Performing Test HAVE_NEON - Failed -- target changed from "" to "auto" -- Detected CPU: kaby-lake -- Performing Test check_cxx_compiler_flagarch_AVX2 -- Performing Test check_cxx_compiler_flagarch_AVX2 - Success -- Found SW: D:/Tesseract/sw-master-windows-client/sw.exe -- sw: processing dependencies Exception in file D:/dev/primitives/src/http/src/http.cpp:254, function download_file: url = https://software-network.org/static/specification.json, curl error: SSL connect error sw command: D:/Tesseract/sw-master-windows-client/sw.exe -shared -platform x86 -compiler msvc-19.16 -d D:/Tesseract/tesseract/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Tesseract/tesseract/build/.sw/cmake/sw.txt -cmake-file-version 4 CMake Error at C:/Users/ASUS/.sw/storage/etc/sw/static/SWConfig.cmake:232 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:318 (sw_execute)

-- Configuring incomplete, errors occurred! See also "D:/Tesseract/tesseract/build/CMakeFiles/CMakeOutput.log". See also "D:/Tesseract/tesseract/build/CMakeFiles/CMakeError.log".

Thanks for any helps...

egorpugin commented 4 years ago

Try sw --self-upgrade and re-run again on both systems.

mokserpent commented 4 years ago

@egorpugin

Thanks for reply, but I tried the command got the error message below

D:\Tesseract\sw-master-windows-client>sw --self-upgrade Downloading signature file Exception in file D:/dev/primitives/src/http/src/http.cpp:254, function download_file: url = https://software-network.org/static/specification.json, curl error: SSL connect error

something wrong??

egorpugin commented 4 years ago

Download the binary from the website. https://software-network.org/client/

mokserpent commented 4 years ago

@egorpugin

I downloaded the sw.exe binary execute file again , and run the sw --self-upgrade again , but got the same error messages

D:\Tesseract\sw-master-windows-client>sw --self-upgrade Downloading signature file Exception in file D:/dev/primitives/src/http/src/http.cpp:254, function download_file: url = https://software-network.org/static/specification.json, curl error: SSL peer certificate or SSH remote key was not OK

My os is windows 10 , installed visual studio 2017 and 2019 ..intel core i7 cpu.. is something required missing or wrong??