icon

@deontic-logic/proof-tool/releases/dyndeps_v1

Dynamic libraries of Cairo 1.17.2, MPIR 2.7.2 and wxWidgets 3.1.3, for MinGW-w64 GCC compiler.

  • Tested and confirmed to work with up to GCC 12.2.0 + LLVM 14.0.6 + MinGW-w64 10.0.0 MSVCRT (release 2).
  • Built for MSVCRT. Make sure to never mix with binaries built to use UCRT.
  • Proclamation: The most recent wxWidgets version that is not broken when built for Windows clients will likely remain to be 3.1.3.
    I have informed the wxWidgets community of major rendering performance issues in MSW mode for the wxGrid component, but was met with contempt because I wouldn't want to create a smaller sample or fix the issue myself. Further context is provided at the building instructions below. (archived forum post)
    They even closed the there mentioned GitHub issue after clarifying how they feel entitled to my time and efforts, and making many false assertions concerning reproducibility, to which I only had to say some rather harsh words.

Usage

  1. Extract the archive's contents to a folder ${LIBS_HOME}. (The archives share files and folders but have no conflicts.)
  2. As GCC C++ Compiler options, add the appropriate include paths using -I flags.
  3. As MinGW C++ Linker options, add the appropriate library search paths using -L flags, and the required libraries using -l flags.
  4. Copy the required DLL files into the directory of the application.

Include Path Options

  • Cairo 1.17.2
    • -I${LIBS_HOME}/cairo-windows-1.17.2/include
  • MPIR 2.7.2
    • -I${LIBS_HOME}/Mpfr315Mpir272/MpfrMpir/Dynamic/Mpfr
  • wxWidgets 3.1.3
    • 32 bit
      • -I${LIBS_HOME}/wxWidgets-3.1.3/lib/wx/include/msw-unicode-3.1 -I${LIBS_HOME}/wxWidgets-3.1.3/include
    • 64 bit
      • -I${LIBS_HOME}/wxWidgets-3.1.3/lib/wx/include/msw-unicode-3.1_x64 -I${LIBS_HOME}/wxWidgets-3.1.3/include

Library Search Path Options

  • Cairo 1.17.2
    • 32 bit
      • -L${LIBS_HOME}/cairo-windows-1.17.2/lib/x86
    • 64 bit
      • -L${LIBS_HOME}/cairo-windows-1.17.2/lib/x64
  • MPIR 2.7.2
    • 32 bit
      • -L${LIBS_HOME}/Mpfr315Mpir272/MpfrMpir/Dynamic/Lib32
    • 64 bit
      • -L${LIBS_HOME}/Mpfr315Mpir272/MpfrMpir/Dynamic/Lib64
  • wxWidgets 3.1.3
    • 32 bit release
      • -L${LIBS_HOME}/wxWidgets-3.1.3/lib/gcc11.2.0_i686-posix-dwarf_dll
    • 32 bit debug
      • -L${LIBS_HOME}/wxWidgets-3.1.3/lib/gcc11.2.0_i686d-posix-dwarf_dll
    • 64 bit release
      • -L${LIBS_HOME}/wxWidgets-3.1.3/lib/gcc11.2.0_x86_64-posix-seh_dll
    • 64 bit debug
      • -L${LIBS_HOME}/wxWidgets-3.1.3/lib/gcc11.2.0_x86_64d-posix-seh_dll

Library Include Options

  • 32 bit
    • -lmpir32 -lcairo -lwx_baseu-3.1.dll -lwx_mswu_core-3.1.dll -lwx_mswu_stc-3.1.dll -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32
  • 64 bit
    • -lmpir64 -lcairo -lwx_baseu-3.1.dll -lwx_mswu_core-3.1.dll -lwx_mswu_stc-3.1.dll -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32

Build

The utilized compilers were taken from GCC 11.2.0 + MinGW-w64 9.0.0 MSVCRT (release 6). The 32 bit variant is posix-dwarf, and the 64 bit variant is posix-seh.
Since wxWidgets has no posix-dwarf releases, at least a personal build targeting 32 bit is required. I also went to build 64 bit libraries, even though there are posix-seh libraries at wxWidgets-3.1.3, built by older MinGW-w64 GCC versions. Static libraries for Cairo 1.17.2 and MPIR 2.7.2 have been obtained from preshing/cairo-windows and atelierweb.com, respectively.

wxWidgets 3.1.3

The success of the official building process on Windows systems depends on intransparent factors. It often fails and tends to require communication overhead to assist getting around flaws in the official building script, which depends on compiler quirks, path properties of third party tools, and even using multi-threaded building. After mentioning these guides to circumvent such issues in their forums (archived), it became apparent that some wxWidgets community members really despise solutions that are thought outside the box, such as this one.
The idea of this guide is to make use of the fact that the building process for Linux distributions is much more reliable, by using a Unix-like environment for configuring the build scripts, which are then modified to work with MinGW-w64 on Windows systems. The execution of a shell script that applies search and replace operations on all the generated makefiles is then sufficient for a full build.
Configuring commands for wxWidgets 3.1.3 that I executed in Mintty's Cygwin64 Terminal while having the appropriate standalone MinGW-w64 compiler version installed:

  • 32 bit

    • ./configure CC=C:/mingw-w64/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw32/bin/gcc CXX=C:/mingw-w64/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw32/bin/g++ --enable-shared --disable-monolithic --with-expat=builtin --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --disable-dependency-tracking
  • 64 bit

    • ./configure CC=C:/mingw-w64/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw64/bin/gcc CXX=C:/mingw-w64/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw64/bin/g++ --enable-shared --disable-monolithic --with-expat=builtin --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --disable-dependency-tracking

For debug builds, --enable-debug must be appended.

In order to replace all generated /cygdrive/[...] paths with valid paths, such that the makefiles can be used outside of Cygwin by the standalone GCC ports, I used a shell script under Windows, which can be configured by installing Mintty — Cygwin Terminal emulator and executing the following in a registry (.reg) file:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\mintty.exe\shell\open\command]
@="\"D:\\cygwin64\\bin\\mintty.exe\" -w max -h always -t \"%1\" -e /bin/bash -li -c 'cd \"$(dirname \"$(cygpath -u \"%1\")\")\" && bash -x \"$(cygpath -u \"%1\")\"'"
; This is a simple registry file to automate the execution of sh via cygwin on Windows 7, might work on other Windows versions ... I did not test.

(Note that CR LF is not a valid line ending in .sh files. There are editors such as Notepad++ to properly view and edit them on Windows.)
The following script does not only replace certain terms in all files in its directory (including subfolders) to correct the makefiles, but also configures them for a better naming of the resulting libraries. I created __replacer.sh into an empty folder (for safety measures), with contents:

#!/bin/bash
grep --exclude="__replacer.sh" -rl '\/cygdrive\/c' ./ | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' ' | xargs sed -i 's/\/cygdrive\/c/C:/g'
grep --exclude="__replacer.sh" -rl '\/cygdrive\/d' ./ | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' ' | xargs sed -i 's/\/cygdrive\/d/D:/g'
grep --exclude="__replacer.sh" -rl 'DLLPREFIX = cyg' ./ | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' ' | xargs sed -i 's/DLLPREFIX = cyg/DLLPREFIX = /g'
grep --exclude="__replacer.sh" -rl 'WXCOMPILER = _gcc' ./ | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' ' | xargs sed -i 's/WXCOMPILER = _gcc/WXCOMPILER = _gcc1120/g'
grep --exclude="__replacer.sh" -rl 'dll___targetsuf3 = -3.$(SO_SUFFIX)' ./ | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' ' | xargs sed -i 's/dll___targetsuf3 = -3.$(SO_SUFFIX)/dll___targetsuf3 = .$(SO_SUFFIX)/g'

The first two lines are corresponding to drive letters C: and D:. For more drives, more such lines should be added. Copying the file to the configured folder and executing it, allows a successful build via CMD, given that the compiler's binary folder has been added to the system environment variable 'Path'.

The applied make commands further customize the names of the libraries to be generated:

  • 32 bit release
    • mingw32-make -j4 BUILD=release UNICODE=1 SHARED=1 VENDOR=i686-posix-dwarf
  • 32 bit debug
    • mingw32-make -j4 BUILD=debug UNICODE=1 SHARED=1 VENDOR=i686d-posix-dwarf
  • 64 bit release
    • mingw32-make -j4 BUILD=release UNICODE=1 SHARED=1 VENDOR=x86_64-posix-seh
  • 64 bit debug
    • mingw32-make -j4 BUILD=debug UNICODE=1 SHARED=1 VENDOR=x86_64d-posix-seh

Walkthrough

  1. Put the MinGW-w64 bin folder path into the system environment variable 'Path', and remove all other paths of GCC versions.
    For example, C:/mingw-w64/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw32/bin for 32 bit
    and C:/mingw-w64/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64-9.0.0-r6/mingw64/bin for 64 bit.
  2. Extract wxWidgets-3.1.3.7z to C:/wxWidgets-3.1.3.
  3. Execute commands in Cygwin64 Terminal:
    • cd C:/wxWidgets-3.1.3
    • ./configure [...] depending on the variant as noted above
      My result of the configure command looked like:
      Which GUI toolkit should wxWidgets use?                 msw
      Should wxWidgets be compiled into single library?       no
      Should wxWidgets be linked as a shared library?         yes
      Should wxWidgets support Unicode?                       yes (using wchar_t)
      What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
      Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                builtin
                                       regex              builtin
                                       tiff               builtin
                                       lzma               no
                                       zlib               builtin
                                       expat              builtin
                                       libmspack          no
                                       sdl                no
      
  4. Copy __replacer.sh into C:/wxWidgets-3.1.3 and execute it.
  5. Shut down Cygwin64 Terminal and open CMD, then execute commands:
    • cd C:/wxWidgets-3.1.3
    • mingw32-make [...] depending on the variant as noted above
      The process should successfully build all the binaries.
  6. Move all the generated .a and .dll files into a new subfolder called
    • 32 bit release
      • gcc11.2.0_i686-posix-dwarf_dll
    • 32 bit debug
      • gcc11.2.0_i686d-posix-dwarf_dll
    • 64 bit release
      • gcc11.2.0_x86_64-posix-seh_dll
    • 64 bit debug
      • gcc11.2.0_x86_64d-posix-seh_dll
  7. For 64 bit, in ./lib/wx/include, rename the generated folder msw-unicode-3.1 to msw-unicode-3.1_x64.