gtkmm3.0 simple example build error



Hi everyone,

I just started getting into gtkmm programming, and I've hit a road block right away. I'm having trouble building the example code at:
http://developer.gnome.org/gtkmm-tutorial/unstable/sec-basics-simple-example.html.en

For reference, the code is:

1 #include <gtkmm.h>
2
3 int main(int argc, char* argv[]) {
4
5 Glib::RefPtr<Gtk::Application> app =
6 Gtk::Application::create(argc, argv, "org.gtkmm.examples.base") ;
7 Gtk::ApplicationWindow window ;
8 return app->run(window) ;
9 }

I'm running into what looks like a linking error when I try to build. Here's what g++ gives me:

$ g++ base.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`
base.cc: In function ‘int main(int, char**)’:
base.cc:5:18: error: ‘Application’ is not a member of ‘Gtk’
base.cc:5:18: error: ‘Application’ is not a member of ‘Gtk’
base.cc:5:34: error: template argument 1 is invalid
base.cc:5:40: error: invalid type in declaration before ‘=’ token
base.cc:6:14: error: ‘Gtk::Application’ has not been declared
base.cc:7:5: error: ‘ApplicationWindow’ is not a member of ‘Gtk’
base.cc:7:28: error: expected ‘;’ before ‘window’
base.cc:8:15: error: base operand of ‘->’ is not a pointer
base.cc:8:21: error: ‘window’ was not declared in this scope

I'm running Fedora 16 with the following gtkmm packages installed:
gtkmm30-debuginfo.i686 : Debug information for package gtkmm30
gtkmm30-devel.i686 : Development files for gtkmm30
gtkmm30-doc.noarch : API documentation for gtkmm30
gtkmm30.i686 : C++ interface for the GTK+ library

Hopefully, I've provided enough information for someone to be able to help, I'd really like to get going on some
gui programming.

Best,

~ Armando Diaz




By the way the command "pkg-config gtkmm-3.0 --cflags --libs" gives the output (in case it helps):

$ pkg-config gtkmm-3.0 --cflags --libs
-DGSEAL_ENABLE -pthread -I/usr/include/gtkmm-3.0 -I/usr/lib/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-3.0 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/gdkmm-3.0/include -I/usr/include/atk-1.0 -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lfreetype -lfontconfig -lgmodule-2.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]