2

I'm working on a gtkmm3.0 app on Ubuntu and OSX.

I tried to make my project in three different enviroments:

  • OSx Big Sur
  • Ubuntu 16.04.7 LTS
  • Ubuntu 20.04.2 LTS

On the first and last one, my project is building well with no warnings and no errors, but in the second one, I'm having a bunch of exceptions(see below)

In file included from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:25:0,
             from /usr/include/glibmm-2.4/glibmm/object.h:34,
             from /usr/include/pangomm-1.4/pangomm/context.h:32,
             from /usr/include/gtkmm-3.0/gtkmm/widget.h:32,
             from /usr/include/gtkmm-3.0/gtkmm/container.h:29,
             from /usr/include/gtkmm-3.0/gtkmm/box.h:28,
             from /home/workspace/CPPND-Linear-System-Solver/src/Gui.h:5,
             from /home/workspace/CPPND-Linear-System-Solver/src/Gui.cpp:1:
/usr/include/glibmm-2.4/glibmm/variant.h:583:55: error: ISO C++1z does not  allow dynamic exception specifications
tatic V_CastTo cast_dynamic(const VariantBase& v) throw(std::bad_cast);
                                               ^~~~~
/usr/include/glibmm-2.4/glibmm/variant.h:630:1: error: ISO C++1z does not allow dynamic exception specifications
throw(std::bad_cast)
^~~~~
/usr/include/glibmm-2.4/glibmm/variant.h:886:1: error: ISO C++1z does not allow dynamic exception specifications
throw(std::bad_cast);
^~~~~
/usr/include/glibmm-2.4/glibmm/variant.h:1069:1: error: ISO C++1z does not allow dynamic exception specifications
throw(std::bad_cast);
^~~~~
/usr/include/glibmm-2.4/glibmm/variant.h:1126:1: error: ISO C++1z does not allow dynamic exception specifications
throw(std::bad_cast);
^~~~~
CMakeFiles/linear_system.dir/build.make:75: recipe for target 'CMakeFiles/linear_system.dir/src/Gui.cpp.o' failed
make[2]: *** [CMakeFiles/linear_system.dir/src/Gui.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/linear_system.dir/all' failed
make[1]: *** [CMakeFiles/linear_system.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I'm googling since yesterday for a possible solution for it, and I did not found anything, but to define the throw which has not worked and seems to me its not a good practice. Also I looked for substitute the box container but besides it will give me so much work, it doesn't make sense to not work because of bad cast error just in one enviroment.

The exception happens on the line that I include the gtkmm/box.h file

and also I created a simple window application and it maked well, so as the exception message says, I think the problem is on the box.h file, but I didn't found a way to workaround it in Ubuntu 16.

App details:

Thank you

BobMorane
  • 3,870
  • 3
  • 20
  • 42
  • What is the gtkmm version of Gtkmm in both Ubuntu version? You can see it by running this: ```std::cout << "Gtkmm version : " << gtk_get_major_version() << "." << gtk_get_minor_version() << "." << gtk_get_micro_version() << std::endl;``` – BobMorane Aug 20 '21 at 12:59
  • 1
    Hello, the gtkmm version on Ubuntu 16.04.7(the one which is not making) is 3.18.9. In the one that the code is making as expected I can't have access now, but I can put here later – João Lucas Gouveia Aug 20 '21 at 13:23
  • Did you understand where the problem comes from? Could you fix it? – BobMorane Oct 04 '21 at 13:24
  • 1
    Nope, I ended by changing the GUI framework to wxWidgets and I could progress on the project :) – João Lucas Gouveia Oct 19 '21 at 13:42

0 Answers0