-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Tesseract from source with Visual Studio #2876
Comments
did you do : |
i did |
I have the same mistake. After executing SW setup (at sw directory)and executing again cmake .. , the problem is solved. |
I'm getting error as follow too: |
may be there are cashed files from SW , if someone know how to clear SW cashed files from previous trials |
Appeyor build seems to use sw and is working. Check out the logs at https://ci.appveyor.com/project/zdenop/tesseract/build/job/c5l28ht5hq3x478q |
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 |
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 |
https://ci.appveyor.com/project/zdenop/tesseract/build/job/66l95n7ofxrs0xtf/artifacts |
thanks @Shreeshrii i dwonloaded the following build But i found only the binaries , where i can find the hedears,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 how i can get the required folders and files from Appeyor build version |
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. |
I succeed to build Tesseract from source by doing the following Also succeded to build OpenCV with Tesseract |
Thanks @zdenop i will try this plog , actually a followed many tutorials but failed to build latest tesseract + OpenCV |
@essamzaky I try your plog,but get this error:
|
copy |
|
@essamzaky this information you have provided saved a lot of time :) thank you very much... For Visual Studio 2019 this works: |
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 , |
Hints about cloning and install paths |
|
@moni179 |
@essamzaky -- Configuring incomplete, errors occurred! |
Hi @egorpugin do you know the reason for the described error |
Hi, @essamzaky As for opencv+tess - check out this example using sw (main file is near to cmake lists) |
@moni179 describe the steps you applied and the error details |
@essamzaky @egorpugin Here is the Error.
|
@jasnei |
Environment
What I did
What I want Thanks |
What does it mean? |
What I mean I'm using OpenCV with vs2017, I would like to build tesseract so that I can use it in vs2017. |
That's better. We have progress. |
No difference if I use -platform x86 (only reported build id is different) |
Ok, please do following:
|
I did step 2 first in simple cmd window, then called vcvarsall.bat, then did it again. Here the output of doing it in VS command prompt: |
Try without |
Much better - there was a lot of traffic in the cmd window. 1179 *.obj files were generated in .sw\t subdirectories, no *.dll, no *.lib, no *.exe. I attach the tail of the cmd window output, which seemed to me as no longer checking my environment, but trying to do real work (?). |
Ok, now it sees your compiler. |
I'm installing a package that is advertized as 9.7 GB. Thank goodness, I needed a new computer in the beginning of 2020 ;-) |
For reference - VS Build Tools https://aka.ms/buildtools |
Now What am I to do next? Where can I find generated executables and libraries? |
They are stored in sw storage ( How do you want to use those libraries? Sw support cmake as integration target. |
Thank you very much!! |
Sorry to call up again: Now the real compilation for libtesseract is going inside VS, I am getting |
This looks like missing support for C++-17. It's the same error which was reported in issue #3255. |
We are upgrading C++ standard in tess, so for master branch you should use the latest VS2019 (or at least VS2017, not sure if it works). |
Now I succeded using the generated libtesseract.vcxproj with VS2019 to make static Debug/libtesseract50d.lib for Win32/x86. And I could link it with my Qt-Project which is generated with VS2015. And I could run it and even debug into the tesseract sources, and the OCR results were OK. |
@BJungmann, |
Indeed in #1223 /O1 was suggested. But now I tested /O1 and /Ox, which were offered in the VS options, and both rendered bad OCR results. Back to /Od, and the results were good. |
Please don't mix two different issues in the same place. Open a new issue for the VS 2019 issue. |
@amitdo, which different issues do you mean? Do you think the poor recognition result on x86 platform with optimization activated is worth a new issue? @egorpugin, is there a recommended way to access leptonica functions directly from my own code? I see no leptonica allheaders.h in the installed tesseract bundle, but I find it hidden in .sw/storage/pkg...., so it should be possible somehow. |
Does |
I want to do it in a Qt Creator project, with no CMake support yet, so I specify the include search pathes manually. I can access an older allheaders.h from leptonica-1.78, but I want to access the same leptonica instance that was used in tesseract50.lib. I don't know how to access the magic in finding things in .se/storage/pkg. |
I tried to run |
Yes. |
I have now opened the new issue #3283. |
Closing this as original post was about compiling from source on windows, which is solved. |
-- sw: processing dependencies I got the error repor when downloading org.sw.demo.preshing.junction-master ,how can I solve the problem? |
I can't write 'sw setup,' and what is this 'sw' folder? |
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:
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:
The text was updated successfully, but these errors were encountered: