2

I am a beginner and learning Gtkmm by following their official documentation.

But this example: https://developer.gnome.org/gtkmm-tutorial/stable/sec-menus-examples.html.en#menu-example-main

is not working and I am getting these kind of errors:

examplewindow.cc: In constructor ‘ExampleWindow::ExampleWindow()’:
examplewindow.cc:18:67: error: no matching function for call to 
‘Gio::SimpleActionGroup::add_action(const char [12], 
sigc::bound_mem_functor0<void, ExampleWindow>)’
sigc::mem_fun(*this, &ExampleWindow::on_menu_file_new_generic));
                                                               ^

The above error is pointed for this bit of code:

refActionGroup->add_action("newstandard",
sigc::mem_fun(*this, &ExampleWindow::on_menu_file_new_generic));

But "on_menu_file_new_generic" function does exist. So if the callback function does exist, then how come it says 'no matching function'?

Any help?

Gurjot Bhatti
  • 977
  • 1
  • 10
  • 24

1 Answers1

1

This error occurs because of older version of glibmm library. My current version of glibmm is 2.37.4 that does not support this method.

This overloaded add_action() method first appeared in glibmm 2.37.6, so in order to get past this error I need to install newer version of glibmm.

Hope others will be able to resolve their errors as well.

Gurjot Bhatti
  • 977
  • 1
  • 10
  • 24
  • And if you want to stick with your current version of glibmm, then I suggest you follow this example https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/menus/main_menu?h=gtkmm-3-2 – Gurjot Bhatti Jul 04 '14 at 17:29