compiling help with gtkmm

I'm trying to learn gtkmm. I tried the tutorial on their website which looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
#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);
}


Now I compile with this command: g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`

and get the following errors:
simple.cc: In function ‘int main(int, char**)’:
simple.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
simple.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
simple.cc:5:32: error: template argument 1 is invalid
simple.cc:5:38: error: invalid type in declaration before ‘=’ token
simple.cc:6:10: error: ‘Gtk::Application’ has not been declared
simple.cc:9:3: error: ‘ApplicationWindow’ is not a member of ‘Gtk’
simple.cc:9:26: error: expected ‘;’ before ‘window’
simple.cc:11:13: error: base operand of ‘->’ is not a pointer
simple.cc:11:19: error: ‘window’ was not declared in this scope

mike
Did you install the gtkmm-3.0 development files?
closed account (S6k9GNh0)
Verify what pkg-config provides you.
i'm also facing same problem, the reason i found was no Gtk::Application in gtkmm help.

modify code and it is compiling & running fine.


#include <gtkmm.h>

int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
kit.run(window);
return 0;
}
Topic archived. No new replies allowed.