Add MinGW-w64 native Windows build support#230
Open
zleamy wants to merge 1 commit intokermitt2:masterfrom
Open
Add MinGW-w64 native Windows build support#230zleamy wants to merge 1 commit intokermitt2:masterfrom
zleamy wants to merge 1 commit intokermitt2:masterfrom
Conversation
Enables building pdfalto on Windows with MSYS2/MinGW-w64, producing
a native PE64 executable without Cygwin dependency. Two files changed:
CMakeLists.txt:
- MinGW: use system libraries via pkg-config instead of vendored
static .a files (which are only built for Linux/Mac)
- Windows link libraries: ole32, uuid, ws2_32 (replacing dl/pthread)
- Conditional include directories: MinGW uses system headers for
libxml2/ICU/freetype; vendored xpdf headers still used
src/XmlAltoOutputDev.cc:
- Replaced "using namespace std;" with explicit using declarations
(17 types) to resolve std::byte conflict between GCC 15's C++17
std::byte enum and Windows SDK's byte typedef in rpcndr.h
Build instructions:
pacman -S mingw-w64-x86_64-{gcc,cmake,libxml2,zlib,libpng,freetype,icu,make}
mkdir build && cd build
cmake .. -G "MinGW Makefiles" -DNO_FONTCONFIG=ON
mingw32-make -j4
Tested: 3.9 MB PE64 binary, processes PDFs correctly with GROBID.
All changes extensively commented for novice developers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables building pdfalto on Windows using MSYS2/MinGW-w64. Produces a native 64-bit Windows executable (3.9 MB) without any Cygwin dependency.
Changes
CMakeLists.txt
ole32,uuid,ws2_32instead ofdl/pthreadsrc/XmlAltoOutputDev.cc
using namespace std;with explicitusingdeclarations for the 17 types actually usedstd::byteconflict between GCC 15 C++17 and Windows SDKrpcndr.hCompanion PR
GROBID Java fixes at grobidOrg/grobid#1424
🤖 Generated with Claude Code