Question

I've just started trying to get GTK+ 3 working with C++ and have tried to compile the simplest GTKmm Hello-World example.

#include <gtkmm.h>

int main(int argc, char *argv[])
{
  Glib::RefPtr<Gtk::Application> app =
    Gtk::Application::create(argc, argv,
      "org.gtkmm.examples.base");

  Gtk::Window window;
  window.set_default_size(200, 200);

  return app->run(window);
}

After compiling with:

g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`

There are no errors, however when I run the newly compiled application with:

./simple

I get the following error:

GLib-GIO-CRITICAL **: g_application_list_actions: assertion `application->priv->is_registered' failed
Segmentation fault (core dumped)

The code has been copied, unchanged from https://developer.gnome.org/gtkmm-tutorial/stable/sec-basics-simple-example.html.en so presumably it's likely to be a configuration issue, however I've frequently used this machine for PyGtk and CommandLine C++ without any issues.

Any help would be greatly appreciated.

Was it helpful?

Solution

This was a bug in gtkmm (probably triggered by a change in GTK+) that has been fixed in gtkmm: https://git.gnome.org/browse/gtkmm/commit/?id=506cba376c0a0e09217ad7f5d597b6723d7f91a6

Maybe you can update your gtkmm version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top