build gtkmm 3.6.0 windows binaries on official gtk 3.6.4 bundle

Here’s how I successfully built my gtkmm windows binaries based on official gtk 3.6.4 bundle.

The environment is windows XP 32 bit.

1) Install MinGW and select components:
mingw32-base
mingw32-gcc-g++
msys-base

2) extract official gtk3 binary bundle (3.6.4-20130921) archive in C:\MinGW\msys\1.0\gtk3

3) create empty folder C:\MinGW\msys\1.0\gtkmm3

4) ENVIRONMENT VARIABLES: be sure that Path includes the following:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\MinGW\msys\1.0\gtk3\bin
and add the variable
PKG_CONFIG_PATH
C:\MinGW\msys\1.0\gtk3\lib\pkgconfig;C:\MinGW\msys\1.0\gtkmm3\lib\pkgconfig

5) Run C:\MinGW\msys\1.0\msys.bat this will create the home directory and open a linux-like terminal

6) the home in my case is C:\MinGW\msys\1.0\home\giu

7) Copy the matching versions of tarballs in the home:
libsigc++-2.2.11
glibmm-2.34.1
atkmm-2.22.6
cairomm-1.10.0
pangomm-2.28.4
gtkmm-3.6.0

8) copy the attached 7 scripts and 4 patches in the home (giu-mingw.7z):
00_all.sh
01_libsigc++.sh
02_glibmm.sh
03_atkmm.sh
04_cairomm.sh
05_pangomm.sh
06_gtkmm.sh
glibmm-2.34.1.patch
cairomm-1.10.0.patch
pangomm-2.28.4.patch
gtkmm-3.6.0.patch

9) create a folder named “logs” in the home if you want to have all configure, make and make install logs

10) run ./00_all.sh and wait for completion

11) in C:\MinGW\msys\1.0\gtkmm3 there are now the folders bin, include and lib
which, merged with the gtk3 bundles, makes the gtkmm3 bundle, here’s my result: gtkmm-3.6.0-win32.7z.

23 Responses to “build gtkmm 3.6.0 windows binaries on official gtk 3.6.4 bundle”

  1. Hugo McPhee says:

    Thanks this has been a great help

  2. Sam says:

    Good work, thanks for posting this. I’m trying to create an environment to cross compile software on Linux targetting Windows. I downloaded your build, but I this error

    /usr/i686-w64-mingw32/include/glibmm-2.4/glibmm/ustring.h:24:26: fatal error: glibmmconfig.h: No such file or directory

    I can’t seem to find any file called glibmmconfig.h

    Cheers, Sam

  3. giuspen says:

    to Sam: you should specify your distribution and version, what packages you installed and your steps before facing the problem in order to have some help.

  4. Paul says:

    Awesome. Thank you so much. Is there a reason this isn’t up on gtkmm.org, yet?

  5. giuspen says:

    Thanks for kind feedback.
    Actually there’s no reason for gtkmm people to at least link this result in their download section.
    I made this work exactly after a request in gtkmm mailing list, I communicated them I succeeded but my work was ignored, the result is that I removed myself from their mailing list 🙂

  6. Pedro Sousa says:

    Hi Guispen,

    I try work distributables and they I can use them with success. Meanwhile I amtrying to compile libxml++ but I am having problems in compiling that library. Did you test it?

  7. giuspen says:

    Hi Pedro, I never built libxml++ since I’ve always used the C library libxml also when working in C++

  8. Pedro Sousa says:

    Hi,

    Can I send you the compilation result to check if you have seen something similar when you compiled gtkmm.

    Best regards

  9. giuspen says:

    Hi Pedro, you can write here the error that blocks you and if I will know how to help you I will.

  10. Pedro Sousa says:

    Hi,

    it is little long, but I will copy it here

    admin@oncontrol_devel ~/libxml++-2.36.0
    $ ./configure –enable-shared –enable-static –prefix=/gtkmm3
    checking for a BSD-compatible install… /bin/install -c
    checking whether build environment is sane… yes
    checking for a thread-safe mkdir -p… /bin/mkdir -p
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking whether make supports nested variables… yes
    checking whether to enable maintainer-specific portions of Makefiles… no
    checking whether make supports GNU make features… yes
    checking for g++… g++
    checking whether the C++ compiler works… yes
    checking for C++ compiler default output file name… a.exe
    checking for suffix of executables… .exe
    checking whether we are cross compiling… no
    checking for suffix of object files… o
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking for style of include used by make… GNU
    checking dependency style of g++… gcc3
    checking build system type… i686-pc-mingw32
    checking host system type… i686-pc-mingw32
    checking how to print strings… printf
    checking for gcc… gcc
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking dependency style of gcc… gcc3
    checking for a sed that does not truncate output… /bin/sed
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking for fgrep… /bin/grep -F
    checking for ld used by gcc… /bin/ld
    checking if the linker (/bin/ld) is GNU ld… yes
    checking for BSD- or MS-compatible name lister (nm)… /bin/nm -B
    checking the name lister (/bin/nm -B) interface… BSD nm
    checking whether ln -s works… no, using cp -pR
    checking the maximum length of command line arguments… 8192
    checking whether the shell understands some XSI constructs… yes
    checking whether the shell understands “+=”… yes
    checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format…
    func_convert_file_msys_to_w32
    checking how to convert i686-pc-mingw32 file names to toolchain format… func_c
    onvert_file_msys_to_w32
    checking for /bin/ld option to reload object files… -r
    checking for objdump… objdump
    checking how to recognize dependent libraries… file_magic ^x86 archive import|
    ^x86 DLL
    checking for dlltool… dlltool
    checking how to associate runtime and link libraries… func_cygming_dll_for_imp
    lib
    checking for ar… ar
    checking for archiver @FILE support… @
    checking for strip… strip
    checking for ranlib… ranlib
    checking command to parse /bin/nm -B output from gcc object… ok
    checking for sysroot… no
    checking for mt… no
    checking if : is a manifest tool… no
    checking how to run the C preprocessor… gcc -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… no
    checking for stdint.h… no
    checking for unistd.h… yes
    checking for dlfcn.h… yes
    checking for as… as
    checking for dlltool… (cached) dlltool
    checking for objdump… (cached) objdump
    checking for objdir… .libs
    checking if gcc supports -fno-rtti -fno-exceptions… no
    checking for gcc option to produce PIC… -DDLL_EXPORT -DPIC
    checking if gcc PIC flag -DDLL_EXPORT -DPIC works… yes
    checking if gcc static flag -static works… no
    checking if gcc supports -c -o file.o… yes
    checking if gcc supports -c -o file.o… (cached) yes
    checking whether the gcc linker (/bin/ld) supports shared libraries… yes
    checking whether -lc should be explicitly linked in… yes
    checking dynamic linker characteristics… Win32 ld.exe
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… yes
    checking whether to build static libraries… yes
    checking how to run the C++ preprocessor… g++ -E
    checking for ld used by g++… /bin/ld
    checking if the linker (/bin/ld) is GNU ld… yes
    checking whether the g++ linker (/bin/ld) supports shared libraries… yes
    checking for g++ option to produce PIC… -DDLL_EXPORT -DPIC
    checking if g++ PIC flag -DDLL_EXPORT -DPIC works… yes
    checking if g++ static flag -static works… no
    checking if g++ supports -c -o file.o… yes
    checking if g++ supports -c -o file.o… (cached) yes
    checking whether the g++ linker (/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… Win32 ld.exe
    checking how to hardcode library paths into programs… immediate
    checking for pkg-config… /c/gtk/bin//pkg-config
    checking pkg-config is at least version 0.9.0… yes
    checking for LIBXMLXX… yes
    checking string usability… yes
    checking string presence… yes
    checking for string… yes
    checking list usability… yes
    checking list presence… yes
    checking for list… yes
    checking map usability… yes
    checking map presence… yes
    checking for map… yes
    checking for perl… /bin/perl
    checking for dot… dot
    checking for doxygen… /c/Program Files/doxygen/bin/doxygen
    checking for xsltproc… xsltproc
    checking for glibmm documentation… c:/gtk/share/doc/glibmm-2.4/reference/glibm
    m-2.4.tag@file:///c:/gtk/share/doc/glibmm-2.4/reference/html
    checking which C++ compiler warning flags to use… -Wall
    checking for xmllint… xmllint
    checking for db2latex… no
    checking for docbook2latex… no
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating examples/Makefile
    config.status: creating docs/reference/Doxyfile
    config.status: creating MSVC_Net2005/libxml++/libxml++.rc
    config.status: creating MSVC_Net2008/libxml++/libxml++.rc
    config.status: creating MSVC_Net2010/libxml++/libxml++.rc
    config.status: creating libxml++-2.6.pc
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: creating libxml++config.h
    config.status: libxml++config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing libtool commands
    config.status: executing MSVC_Net2005/libxml++/libxml++config.h commands
    config.status: executing MSVC_Net2008/libxml++/libxml++config.h commands
    config.status: executing MSVC_Net2010/libxml++/libxml++config.h commands

    admin@oncontrol_devel ~/libxml++-2.36.0
    $ make
    make all-recursive
    make[1]: Entering directory `/home/admin/libxml++-2.36.0′
    Making all in .
    make[2]: Entering directory `/home/admin/libxml++-2.36.0′
    depbase=`echo libxml++/attribute.lo | sed ‘s|[^/]*$|.deps/&|;s|\.lo$||’`;\
    /bin/sh ./libtool –tag=CXX –mode=compile g++ -DHAVE_CONFIG_H -DLIBX
    MLPP_BUILD -I. -I. -I. -mms-bitfields -Ic:/gtk/include/libxml2 -Ic:/gtk/includ
    e/glibmm-2.4 -Ic:/gtk/lib/glibmm-2.4/include -Ic:/gtk/include/glib-2.0 -Ic:/gtk/
    lib/glib-2.0/include -Ic:/gtk/include/sigc++-2.0 -Ic:/gtk/lib/sigc++-2.0/include
    -Wall -g -O2 -MT libxml++/attribute.lo -MD -MP -MF $depbase.Tpo -c -o libxml+
    +/attribute.lo libxml++/attribute.cc &&\
    mv -f $depbase.Tpo $depbase.Plo
    libtool: compile: g++ -DHAVE_CONFIG_H -DLIBXMLPP_BUILD -I. -I. -I. -mms-bitfiel
    ds -Ic:/gtk/include/libxml2 -Ic:/gtk/include/glibmm-2.4 -Ic:/gtk/lib/glibmm-2.4/
    include -Ic:/gtk/include/glib-2.0 -Ic:/gtk/lib/glib-2.0/include -Ic:/gtk/include
    /sigc++-2.0 -Ic:/gtk/lib/sigc++-2.0/include -Wall -g -O2 -MT libxml++/attribute.
    lo -MD -MP -MF libxml++/.deps/attribute.Tpo -c libxml++/attribute.cc -DDLL_EXPO
    RT -DPIC -o libxml++/.libs/attribute.o
    In file included from ./libxml++/attribute.h:11,
    from libxml++/attribute.cc:7:
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:861: error: ISO C++ forbids declarati
    on of `wostringstream’ with no type
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:861: error: expected `;’ before “Stre
    amType”
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:865: error: `StreamType’ does not nam
    e a type
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:906: error: expected constructor, des
    tructor, or type conversion before ‘&’ token
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:906: error: expected `,’ or `;’ befor
    e ‘&’ token
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:912: error: expected constructor, des
    tructor, or type conversion before ‘&’ token
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:912: error: expected `,’ or `;’ befor
    e ‘&’ token
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h: In member function `void Glib::ustri
    ng::FormatStream::stream(const T&)’:
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:1057: error: `stream_’ undeclared (fi
    rst use this function)
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:1057: error: (Each undeclared identif
    ier is reported only once for each function it appears in.)
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h: In member function `void Glib::ustri
    ng::FormatStream::stream(const char*)’:
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:1063: error: `stream_’ undeclared (fi
    rst use this function)
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h: In member function `void Glib::ustri
    ng::FormatStream::stream(char*)’:
    c:/gtk/include/glibmm-2.4/glibmm/ustring.h:1069: error: `stream_’ undeclared (fi
    rst use this function)
    make[2]: *** [libxml++/attribute.lo] Error 1
    make[2]: Leaving directory `/home/admin/libxml++-2.36.0′
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/admin/libxml++-2.36.0′
    make: *** [all] Error 2

    I have compiled successfully other projects against glibmm. What bothers me is that I don’t understand why I am having this problem here.

  11. giuspen says:

    Hi Pedro, the right version may be libxml++-2.34.x, are you sure about 2.36.0? If I would be in you I would start trying other versions since this seems a problem related to a mismatching library.

  12. Pedro Sousa says:

    Hi giuspen,

    Thanks for your patience.

    I looked deep and check that the compilation error is in line 861 from ustring.h

    #ifdef GLIBMM_HAVE_WIDE_STREAM
    typedef std::wostringstream StreamType;
    #else
    typedef std::ostringstream StreamType;
    #endif
    StreamType stream_;

    I also checked the include files and they are correct (sstream). Did you compiled Glib with wide stream?
    Even so I do not understand because we are in compilation stage and std::wostringstream shoul be part of g++.

  13. giuspen says:

    Hi Pedro,
    I left all default configure options when building glibmm.
    You can try to edit my scripts and rebuild glibmm or check between libxml++ configure options (./configure -h) if you can fix the build.

  14. Pedro Sousa says:

    Hi Giuspen,

    I found the problem. I had conflicting packages in MingW, which provide me two diferent versions of g++.

    The compilation went ok, but I have now a problem in libtool

    libtool: compile: g++ -DHAVE_CONFIG_H -DLIBXMLPP_BUILD -I. -I. -I. -mms-bitfiel
    ds -Ic:/gtk/include/libxml2 -Ic:/gtk/include/glibmm-2.4 -Ic:/gtk/lib/glibmm-2.4/
    include -Ic:/gtk/include/glib-2.0 -Ic:/gtk/lib/glib-2.0/include -Ic:/gtk/include
    /sigc++-2.0 -Ic:/gtk/lib/sigc++-2.0/include -Wall -g -O2 -MT libxml++/validators
    /validator.lo -MD -MP -MF libxml++/validators/.deps/validator.Tpo -c libxml++/va
    lidators/validator.cc -o libxml++/validators/validator.o >/dev/null 2>&1
    /bin/sh ./libtool –tag=CXX –mode=link g++ -Wall -g -O2 -version-info 2:7:0
    -no-undefined -o libxml++/libxml++-2.6.la -rpath /usr/local/lib libxml++/attrib
    ute.lo libxml++/document.lo libxml++/dtd.lo libxml++/keepblanks.lo libxml++/nonc
    opyable.lo libxml++/schema.lo libxml++/exceptions/exception.lo libxml++/exceptio
    ns/parse_error.lo libxml++/exceptions/validity_error.lo libxml++/exceptions/inte
    rnal_error.lo libxml++/io/istreamparserinputbuffer.lo libxml++/io/outputbuffer.l
    o libxml++/io/ostreamoutputbuffer.lo libxml++/io/parserinputbuffer.lo libxml++/n
    odes/cdatanode.lo libxml++/nodes/commentnode.lo libxml++/nodes/contentnode.lo li
    bxml++/nodes/entityreference.lo libxml++/nodes/element.lo libxml++/nodes/node.lo
    libxml++/nodes/processinginstructionnode.lo libxml++/nodes/textnode.lo libxml++
    /parsers/parser.lo libxml++/parsers/saxparser.lo libxml++/parsers/domparser.lo l
    ibxml++/parsers/textreader.lo libxml++/validators/dtdvalidator.lo libxml++/valid
    ators/schemavalidator.lo libxml++/validators/validator.lo -Lc:/gtk/lib -lx
    ml2 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lintl -lsigc-2.0
    libtool: link: warning: library `c:/gtk/lib/libglibmm-2.4.la’ was moved.
    /bin/grep: /gtkmm3/lib/libsigc-2.0.la: No such file or directory
    /bin/sed: can’t read /gtkmm3/lib/libsigc-2.0.la: No such file or directory
    libtool: link: `/gtkmm3/lib/libsigc-2.0.la’ is not a valid libtool archive
    make[1]: *** [libxml++/libxml++-2.6.la] Error 1
    make[1]: Leaving directory `/home/admin/libxml++-2.34.2′
    make: *** [all] Error 2

    I am trying to fix it. If you have a hint, please provide me with it.

    Thanks

  15. giuspen says:

    I’m sorry I don’t know how to solve this, should try to do it myself but have no time in this period. Greetings.

  16. Pedro Sousa says:

    Hi Giuspen,

    I found and solve my problem. I had .la file with wrong directory paths written.

    I am now a little busy, but at september I would like to create distributables for gtkmm to mingw. Can I take your help’

    Best regards,
    Pedro

  17. giuspen says:

    Hi Pedro, you should try to ping also the guys behind gtkmm about this, they ignored me but may give more credit to you 🙂
    Greetings.

  18. codekiddy says:

    this sounds too easy to be true, I downloaded all as you described and hit ./00_all.sh 😀

    If all this is for real then I hope to make some fresh gtkmm3 code soon, thank you so much for this time saving tutorial!

  19. codekiddy says:

    hi, I would like to report that this did not work. only bunch of errors, I’m not even trying to debug these. it’s just easier to download the installer.

  20. codekiddy says:

    hi, it’s me again, a small correction on my previous two post, I would like to confirm that you methods work, I was able to build gtkmm, but requirement to do so was to install complete GnuWin32 collection of tools, also one needs to add binaries of gnuwin32 to the path ENV variable.
    then everything goes just fine.

    Thank you for sharing giusped!

  21. Richard says:

    Hi. What version of MinGW have you used? 4.7.1 or 4.8.1?

  22. giuspen says:

    Hi, I cannot be sure about the version I used since I updated my installation more times recently, I’m sorry.

  23. deltamish says:

    Hi thanks for providing the build libraries..

    But when i include the header files in vs 2012.. There is one after one error making me go through each folder and add them to addtional header files…

    Can you please be kind enough to tell the header files i should include and the linkers as well

    Thanks

Leave a Reply

*