0

Trying to compile a program written in c++17 and depending on gtk and glibmm and I get the following error on compilation:

/usr/include/glibmm-2.4/glibmm/variant.h:498:1: error: ISO C++17 does not allow dynamic exception specifications
  498 | throw(std::bad_cast)

As a workaround, i've tried patching variant.h with the following:

#if __cplusplus >= 201703L
    #define throw(...)
#endif

But i got more and more glib define errors (related to throw).

I wonder if it is possible to do this by passing a compiler flag instead?

no more sigsegv
  • 468
  • 5
  • 17
  • 2
    easiest to update to a more recent version of glibmm if you can – Alan Birtles Aug 10 '23 at 09:46
  • I do not remember any compilers with what that throw(...) wasn't just unneeded bloat. So contribution to get rid of it in whatever old open source code base should come from users of such, not from compilers supporting that nonsense forever. – Öö Tiib Aug 10 '23 at 09:52
  • 2
    @ÖöTiib it's already been fixed 6 years ago: https://gitlab.gnome.org/GNOME/glibmm/-/commit/140a8e67dbac6133ea940da8d902f39900664997 – Alan Birtles Aug 10 '23 at 09:55

0 Answers0