Re: [gtkmm] no matching function for call to `Gtk::Main::run (Gtk::Window &)'



On Sat, 28 Sep 2002 02:00:50 +0000
"Kirk Morrow" <kirk_morrow hotmail com> wrote:

> I can't get the first sample program in the tutorial to compile.  The code 
> is:
> 
> #include <gtkmm.h>
> 
> int main(int argc, char *argv[])
> {
>    Gtk::Main kit(argc, argv);
> 
>    Gtk::Window window;
>    kit.run(window);
> 
>    return 0;
> }
> 
> First of all, <gtkmm.h> had to be changed to <gtk--.h>.
> 

This indicated that your system is using gtkmm-1.2...

> Second, `pkg-config gtkmm-2.0 --cflags --libs` (or gtkmm-1.2 in my case) 
> doesn't work.  It complains about not finding a file called gtkmm-1.2.pc and 
> setting the
> environment variable PKG_CONFIG_PATH.  However, no such file was installed 
> with
> any of the following RPMS:
> 

pkg-config is for gtkmm2. Do you want to use gtkmm-1.2 (which is a c++ wrapper for gtk-1.2) or gtkmm2 (c++ wrapper for gtk2)?

> gnomemm-1.1.15-1.i386.rpm
> gnomemm-devel-1.1.15-1.i386.rpm
> gtkmm-1.2.5-1.i386.rpm
> gtkmm-devel-1.2.5-1.i386.rpm
> libsigc++-1.0.1-0_helix_1.i386.rpm
> libsigc++-devel-1.0.1-0_helix_1.i386.rpm
> 

Those are gtkmm-1.2 packages...

> Instead, I compile using:
> 
> g++ `sigc-config --cflags --libs` `gtkmm-config --cflags --libs` `gtk-config 
> --cflags --libs` -I/usr/include/gnome-- base.cc
> 
> Now attempting to compile results in:
> 
> base.cc: In function `int main (int, char **)':
> base.cc:8: no matching function for call to `Gtk::Main::run
> (Gtk::Window &)'
> /usr/include/gtk--/main.h:168: candidates are: static void
> Gtk::Main::run ()
> 

Gtk::Main::run(Widget&) is not present in gtk-1.2.

> If I change "kit.run(window);" to "kit.run();", it compiles.  However when I 
> run
> no window appears, as I would aspect, and it just sits waiting for me to 
> press ^C.

You might want to do:

window.show();

but i'm not sure about this one. If you don't need gtkmm-1.2 for a special purpose you should consider using gtkmm2 since it is a great improvement over gtk*-1.2

/Daniel

> 
> I'm not a programming newbie, but I am a GUI programming newbie and any 
> assistance
> is greatly appreciated.  Thanx.
> 
> 
> ** Unsolicited commercial Email delivered to this address will be
> subject to a $1500 charge. Emailing such items, whether manually or
> automatically, constitutes acceptance of these terms & conditions.**
> 
> kirk_morrow hotmail com
> 
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 



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