[PR #592] [MERGED] Solved the Windows dependency hell #1434

Closed
opened 2026-01-29 17:16:24 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/592
Author: @Izaron
Created: 1/1/2017
Status: Merged
Merged: 1/1/2017
Merged by: @cfsmp3

Base: masterHead: tess-solution


📝 Commits (1)

  • 2942e84 Solved the Windows dependency hell

📊 Changes

42 files changed (+51 additions, -60 deletions)

View changed files

📝 src/ccextractor.c (+1 -0)
📝 src/lib_ccx/ccx_common_constants.h (+1 -1)
📝 src/lib_ccx/telxcc.c (+6 -6)
📝 windows/ccextractor.vcxproj (+43 -53)
windows/libs/lib/debug-dll/pvt.cppan.demo.danbloomberg.leptonica-master.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.google.tesseract.tesseract-master.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.jpeg-9.2.0.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.openjpeg.openjp2-2.1.2.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.png-1.6.26.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.tiff-4.0.7.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.xz_utils.lzma-5.2.2.dll (+0 -0)
windows/libs/lib/debug-dll/pvt.cppan.demo.zlib-1.2.8.dll (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.danbloomberg.leptonica-1.74.0.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.danbloomberg.leptonica-master.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.gif-5.1.4.lib (+0 -0)
📝 windows/libs/lib/debug-lib/pvt.cppan.demo.google.tesseract.tesseract-master.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.jpeg-9.2.0.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.mgk25.jbig.ar-2.1.0.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.mgk25.jbig.jbig-2.1.0.lib (+0 -0)
windows/libs/lib/debug-lib/pvt.cppan.demo.openjpeg.openjp2-2.1.2.lib (+0 -0)

...and 22 more files

📄 Description

Finally, after heaps of time, I solved the dependency hell on Windows.
I needed the library files for dependencies. In order to build them from scratch, I used cppan program - the official building tool for Tesseract developers.
Unfortunately, it proved to be quite raw, and I with the cppan coder (in chat) solved a lot of problems related to its work (I was looking for, he corrected). Literally in the last week was added support of v140_xp and /MT flags. Also a bunch (or evens tons) of other small nasty bugs have been fixed (e.g. lzma library what was necessary for leptonica, was able to building only from Vista, we fixed his config file on server)

Unfortunately, there are side effect - tiff dependence library for leptonica (his lowest possible version) was able to building only in v140_xp, because in v120_xp it gave an error (about missing symbols), because this already does not support old platform toolset. It does not depend on cppan. This means that the whole set can be built in Visual Studio 2015 at least. Open .sln with Visual Studio 2015.

How do I get the files - place in the project root file cppan.yml and run in cmd.exe cppan --build . (The author gave me a newest version of the client in the chat) two times for Debug and Release.
Then the .exe file and .sln (has all the desired settings) created in root. Other resources (headers, .lib files) are available somewhere in C:/Users/user/.cppan/ directory. Now you just need to very carefully copy the .sln configuration in our file to make things work.

In fact, we can edit the library code and recompile it. So I fixed this bug https://github.com/tesseract-ocr/tesseract/issues/631 and recompiled tesseract's .sln in C:/Users/user/.cppan/lnk ang got true .lib.

What we get:

  • The entire ccextractorwinfull.exe built in Release-Full configuration weighs 4,4mb and does not require any dll and runs on clean Windows XP and higher (tested in VirtualBox)
  • We can edit the code of the libraries as we want (without 3-rd party cppan)
  • We can easily update project dependencies without headaches

Now there were small bugs:

  • Must include leptonica's "allheaders.h" in ccextractor.c for msgSetSeverity
  • Define "UNDEF" already declared somewhere in Leptonica, so I have to rename our "UNDEF" to "UNDEFINE"

TODO:
When I added ffmpeg for hardsubx, I did not check it on Windows https://github.com/CCExtractor/ccextractor/pull/557 Current .lib and .dll files do not works at Windows XP (and somewhere else), so all I need - waiting for cppan guy to adding ffmpeg libraries and build it. So far I've disabled ENABLE_HARDSUBX.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/592 **Author:** [@Izaron](https://github.com/Izaron) **Created:** 1/1/2017 **Status:** ✅ Merged **Merged:** 1/1/2017 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `tess-solution` --- ### 📝 Commits (1) - [`2942e84`](https://github.com/CCExtractor/ccextractor/commit/2942e84a6f9a97cfd59bcdf045866df37961afc7) Solved the Windows dependency hell ### 📊 Changes **42 files changed** (+51 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src/ccextractor.c` (+1 -0) 📝 `src/lib_ccx/ccx_common_constants.h` (+1 -1) 📝 `src/lib_ccx/telxcc.c` (+6 -6) 📝 `windows/ccextractor.vcxproj` (+43 -53) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.danbloomberg.leptonica-master.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.google.tesseract.tesseract-master.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.jpeg-9.2.0.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.openjpeg.openjp2-2.1.2.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.png-1.6.26.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.tiff-4.0.7.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.xz_utils.lzma-5.2.2.dll` (+0 -0) ➖ `windows/libs/lib/debug-dll/pvt.cppan.demo.zlib-1.2.8.dll` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.danbloomberg.leptonica-1.74.0.lib` (+0 -0) ➖ `windows/libs/lib/debug-lib/pvt.cppan.demo.danbloomberg.leptonica-master.lib` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.gif-5.1.4.lib` (+0 -0) 📝 `windows/libs/lib/debug-lib/pvt.cppan.demo.google.tesseract.tesseract-master.lib` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.jpeg-9.2.0.lib` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.mgk25.jbig.ar-2.1.0.lib` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.mgk25.jbig.jbig-2.1.0.lib` (+0 -0) ➕ `windows/libs/lib/debug-lib/pvt.cppan.demo.openjpeg.openjp2-2.1.2.lib` (+0 -0) _...and 22 more files_ </details> ### 📄 Description Finally, after heaps of time, I solved the dependency hell on Windows. I needed the library files for dependencies. In order to build them from scratch, I used cppan program - the official building tool for Tesseract developers. Unfortunately, it proved to be quite raw, and I with the cppan coder (in chat) solved a lot of problems related to its work (I was looking for, he corrected). Literally in the last week was added support of v140_xp and /MT flags. Also a bunch (or evens tons) of other small nasty bugs have been fixed (e.g. lzma library what was necessary for leptonica, was able to building only from Vista, we fixed his config file on server) Unfortunately, there are side effect - tiff dependence library for leptonica (his lowest possible version) was able to building only in v140_xp, because in v120_xp it gave an error (about missing symbols), because this already does not support old platform toolset. It does not depend on cppan. This means that the whole set can be built in Visual Studio 2015 at least. **Open .sln with Visual Studio 2015.** How do I get the files - place in the project root file [cppan.yml](https://gist.github.com/Izaron/428324dcb45546b06b6ee53ef1621332) and run in cmd.exe `cppan --build .` (The author gave me a newest version of the client in the chat) two times for Debug and Release. Then the .exe file and .sln (has all the desired settings) created in root. Other resources (headers, .lib files) are available somewhere in C:/Users/user/.cppan/ directory. Now you just need to very carefully copy the .sln configuration in our file to make things work. In fact, we can edit the library code and recompile it. So I fixed this bug https://github.com/tesseract-ocr/tesseract/issues/631 and recompiled tesseract's .sln in C:/Users/user/.cppan/lnk ang got true .lib. What we get: - The entire ccextractorwinfull.exe built in Release-Full configuration weighs 4,4mb and does not require **any dll** and runs on clean Windows XP and higher (tested in VirtualBox) - We can edit the code of the libraries as we want (without 3-rd party cppan) - We can easily update project dependencies without headaches Now there were small bugs: - Must include leptonica's "allheaders.h" in ccextractor.c for msgSetSeverity - Define "UNDEF" already declared somewhere in Leptonica, so I have to rename our "UNDEF" to "UNDEFINE" **TODO:** When I added ffmpeg for hardsubx, I did not check it on Windows https://github.com/CCExtractor/ccextractor/pull/557 Current .lib and .dll files do not works at Windows XP (and somewhere else), so all I need - waiting for cppan guy to adding ffmpeg libraries and build it. So far I've disabled ENABLE_HARDSUBX. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:16:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1434