Searock
December 5th, 2012, 02:58 PM
I've recently downloaded and installed gtkmm 3.0 and tried to compile hello world example from their documentation (http://developer.gnome.org/gtkmm-tutorial/3.4/sec-basics-simple-example.html.en)
#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);
}
but it fails to compile and I get the following errors
searock@searock:~/snippets$ g++ test.cc -o test `pkg-config gtkmm-3.0 --cflags --libs`
test.cc: In function ‘int main(int, char**)’:
test.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
test.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
test.cc:5:32: error: template argument 1 is invalid
test.cc:5:38: error: invalid type in declaration before ‘=’ token
test.cc:6:10: error: ‘Gtk::Application’ has not been declared
test.cc:9:3: error: ‘ApplicationWindow’ is not a member of ‘Gtk’
test.cc:9:26: error: expected ‘;’ before ‘window’
test.cc:11:13: error: base operand of ‘->’ is not a pointer
test.cc:11:19: error: ‘window’ was not declared in this scope
When I tried searching for the errors I found that Gtk::Application::create method is available from gtkmm 3.4 and my version is gtkmm 3.0
And I also found another snippet which compiled and ran successfully.
#include <gtkmm.h>
int main(int argc, char *argv[]) {
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
Does this mean that examples in official gtkmm documentation will only work in 3.4 or above?
Do they have a documentation for 3.0 version?
I'm confused as they have only released unstable version upto gtkmm 3.1
#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);
}
but it fails to compile and I get the following errors
searock@searock:~/snippets$ g++ test.cc -o test `pkg-config gtkmm-3.0 --cflags --libs`
test.cc: In function ‘int main(int, char**)’:
test.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
test.cc:5:16: error: ‘Application’ is not a member of ‘Gtk’
test.cc:5:32: error: template argument 1 is invalid
test.cc:5:38: error: invalid type in declaration before ‘=’ token
test.cc:6:10: error: ‘Gtk::Application’ has not been declared
test.cc:9:3: error: ‘ApplicationWindow’ is not a member of ‘Gtk’
test.cc:9:26: error: expected ‘;’ before ‘window’
test.cc:11:13: error: base operand of ‘->’ is not a pointer
test.cc:11:19: error: ‘window’ was not declared in this scope
When I tried searching for the errors I found that Gtk::Application::create method is available from gtkmm 3.4 and my version is gtkmm 3.0
And I also found another snippet which compiled and ran successfully.
#include <gtkmm.h>
int main(int argc, char *argv[]) {
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
Does this mean that examples in official gtkmm documentation will only work in 3.4 or above?
Do they have a documentation for 3.0 version?
I'm confused as they have only released unstable version upto gtkmm 3.1