1

I've been fighting for a month solid to build a //working// C++/gtkmm-3.0 application on Windows with MinGW. I finally managed to get the libraries, MinGW, and Codeblocks to get along on Windows XP (VirtualBox). However, when I try to build, I get the following errors.

These are the most recent versions of gtkmm-3.0 and dependencies. I got them via MSYS2, though I cannot build in that environment for reasons yet unknown. So, as is oft recommended, I copied them over to the MinGW /lib and /include directories, and ensured pkg-config could find them. All's well there (allegedly).

These problems are not originating from my code, obviously. I didn't write or modify gtkmm. Yet, I can't get these to go away.

It is worth mentioning that I was last getting errors relating to "cannot find glib::ustring::ustring", and it decided to stop whining about that and give me these out of the blue instead. If the earlier messages ever show up again, I'll post them here.

I'm beginning to think it isn't worth releasing this software on Windows at all.

NOTE: I am getting over 50 of these, all in gtkmm-3.0 and its dependency libraries, all originating from line 1 or 2 of main, and all with the exact same details. I'll show only a few in interest of space.

-------------- Build: Debug in infiltrator (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -std=c++11 -Wall -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Wl,-luuid -LC:/dev/MinGW/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -lwinmm -lz -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -lintl -std=c++11 -Wall -g -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Wl,-luuid -LC:/dev/MinGW/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -lwinmm -lz -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -lintl -std=c++11 -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Iinclude -IC:\dev\MinGW\include -c "C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp" -o obj\Debug\main.o
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontset.h:33:0,
                 from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:37,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h:98:11: error: looser throw specifier for 'virtual Pango::Font::~Font()'
In file included from C:/dev/MinGW/include/glibmm-2.4/glibmm/binding.h:23:0,
                 from C:/dev/MinGW/include/glibmm-2.4/glibmm.h:96,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:1:
C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h:117:11: error:   overriding 'virtual Glib::Object::~Object() noexcept (true)'
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:37:0,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/fontset.h:81:11: error: looser throw specifier for 'virtual Pango::Fontset::~Fontset()'
In file included from C:/dev/MinGW/include/glibmm-2.4/glibmm/binding.h:23:0,
                 from C:/dev/MinGW/include/glibmm-2.4/glibmm.h:96,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:1:
C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h:117:11: error:   overriding 'virtual Glib::Object::~Object() noexcept (true)'
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontfamily.h:34:0,
                 from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontmap.h:36,
                 from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:38,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/fontface.h:81:11: error: looser throw specifier for 'virtual Pango::FontFace::~FontFace()'
In file included from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:41:0,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
                 from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
                 from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/gtkmm-3.0/gtkmm/buildable.h:107:11: error: looser throw specifier for 'virtual Gtk::Buildable::~Buildable()'
Process terminated with status 1 (0 minute(s), 6 second(s))
50 error(s), 0 warning(s) (0 minute(s), 6 second(s))

This type of error message seems to pop up with other stable, working projects and library being built on Windows, aside from gtkmm.

My best guess is that I forgot some compiler flag, setting, or other bright-blazingly obvious step in the build process. I will hasten to remind the reader that I am on CodeBlocks (13.14), so I didn't write that build command myself.


Requested Info mingw32-g++.exe --version

mingw32-g++.exe (tdm-1) 4.7.1

This is the version that came bundled with CodeBlocks 13.14.

...

I will hasten to remind everyone that I didn't write any aspect of gtkmm or its dependencies, which is where all of these errors are originating. Also, this is a fully stable version, NOT a beta or development snapshot. Second, this exact same code is working with the exact same versions of the library on my Linux build.

That said, here are the complete lines of code from the requested locations.

C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h, line 117

virtual ~Object() noexcept; //It should only be deleted by the callback.

C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h, line 98

virtual ~Font();

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • Can you please post the complete declaration of `virtual Glib::Object::~Object()` as it appears at your `C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h` line 117 and that of `'virtual Pango::Font::~Font()` as it appears at your `C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h` line 98. – Mike Kinghan Oct 01 '15 at 19:25
  • And also the output of `mingw32-g++.exe --version` – Mike Kinghan Oct 01 '15 at 19:42
  • Added that information to the bottom of my question. Thanks for looking at this. :) – CodeMouse92 Oct 01 '15 at 20:33

1 Answers1

2

Your g++ version is too old for this code: 4.7.x had a half-baked way with the reconciliation of explicit and implied exception specifications between inherited member functions, as in this case between the virtual destructor of Glib::Object and that of Pango::Font.

You need to upgrade to at least GCC 4.8.1 - which happens to be the latest stable version from MinGW. You can get well up-to-date Windows port of GCC from TDM. Latest there is 5.1

P.S. I am a little suspicious as to whether you have builds of glibmm-2.4 and pangomm-1.4 that are really in sync. I have the sources of these packages both official per my linux distro (Ubuntu 15.04), and the line numbers of the specimen problem declarations that I enquired about are different from yours and neither of them has a noexcept specification which certainly avoids the snag.

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
  • Excellent! I will check into both of these. Since I know my around the folder structure for the build environment, I should be able to upgrade it no problem. I'll also double check `glibmm-2.4` and `pangomm-1.4`, which I will have to pull down again via my MSYS2. Once all this is done and dusted, I think I'll make an installer to create that build environment folder, and save other people the headache for this version of gtkmm! – CodeMouse92 Oct 01 '15 at 22:12
  • You can simply install another GCC toolchain (besides or instead of the the once you've got) independently of Code::Blocks. It has no essential binding to a bundled tool chain. You can configure C::B to support as many compilers as you've got and take your pick. – Mike Kinghan Oct 01 '15 at 22:45
  • Oh yeah, I know. I've just got everything set up in a single file. I might as well replace the old version of MinGW in this setup anyway, as it really doesn't serve any purpose for me. Most of my builds rely on the `mm` stuff. I actually yanked the MinGW directory from the CodeBlocks installation, moved it to `C:\dev`, and then put all my libraries in the `\bin`, `\lib` and `\include`. MASSIVE time saver. :) – CodeMouse92 Oct 01 '15 at 23:02
  • I'll try this out tomorrow and let you know how it goes, by the way. If it solves it (it probably will), I will accept. :) – CodeMouse92 Oct 01 '15 at 23:07
  • That solved this batch of errors. I'm getting full compile..but no run. Now my problem relates to this error message: http://stackoverflow.com/q/17410718/472647. So I have to figure out what needs to be rebuilt how and why. :'( – CodeMouse92 Oct 02 '15 at 23:50
  • Update #2...hmmm, perhaps I should use the TW2 instead of the SJLJ version...? – CodeMouse92 Oct 03 '15 at 00:02
  • Thanks again for the help on this question! Got all those problems fixed, but still no build. Now the saga continues at http://stackoverflow.com/q/32919083/472647, if you're curious. – CodeMouse92 Oct 03 '15 at 05:04