I had that problem too. I ended up using the workaround shown in the sample below. Maybe someone else can shine in with a better solution to this problem.
#include <gtkmm.h>
int main(int argc, char *argv[])
{
argc = 1;
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));
}
I 'lie' to Gtk::Application::create() by telling it that there were no argument in the command line. This way you can handle (or ignore) the command line arguments yourself. If you do not set argc to 1 and there are arguments, the app will abort with the message "This application can not open files". I hope this helps.