Re: Gtk, C++ & Trouble



Have you wrapped your '#include <gtk.h>' inside an 'extern "C"', a la

extern "C" {
  #include <gtk.h>
}

In fact, all your includes of C headers need this wrapper.

If not, try that first.  If it works for you, and you're not sure why,
check out http://www.tldp.org/HOWTO/C++-dlopen/thesolution.html

Daryl

On Sun, 2005-12-04 at 00:08 -0300, Tomaz Canabrava wrote:
hy all.
I'm trying to use C++ but not the gtkmm, i'm using the c - version of Gtk

and i get into trouble when trying to connect a signal handler to a member
of a class.

the code:

class blah{
        public:
            blah();
        private:
               GtkWidget *button;
}

blah::blah(){
       GladeXML x= (somefile, "Window", NULL);
       button = glade_xml_get_widget(x, "button_OK");
      g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
}


The Error:
(on  the line that is the g_signal_connect)
../Gui/AddRevistaGui.cpp:: error: invalid use of member (did you forget the
'&' ?)
make: ** [Gui/AddRevistaGui.o] Erro 1

Anyone can help?
(but please, dont say 'use the gtkmm', because i  dont' managed to compile
it on windows =/)

--
Um Computador sem Windows à como um Navio sem danÃarinas de Can-Can
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
Daryl Lee
Open the Present--It's a Gift.




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