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:
- C++17
- gtkmm3.0
- glib 2.4(in both ubuntu versions)
- Installed all the gtkmm3.0 requirements previously the make, on https://www.gtkmm.org/en/download.html
Thank you