Error Meaning GLib-GIO-CRITICAL

I successfully compiled the following simple.cc program:

#include <gtkmm.h>

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

  Gtk::ApplicationWindow window;

  return app->run(window);
}

using the following command:

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

This gave me a simple executable, but when I tried to run it, I got the following error:

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

As far as I can tell, I have the latest and best GLib packages. I am running Ubuntu 12.04 LTS.

+5
source share
2 answers

I had the same problem as in the same tutorial. Replace:

    Gtk::ApplicationWindow window;

with

    GTK::Window window;

If you read the code description in the tutorial, the latter is actually the code in question. Making this change made the program work for me.

+12
source

Try connecting your window to the application instance. Create it as follows:

Gtk::ApplicationWindow window(app);
0
source

All Articles