callback function problem



 I wrote a callback func like this:

 void callback2menu (GtkWidget *widget, gpointer *data)
{
        struct menu_itemz connect_to;
                void menuitem_response_tty(gchar *tty){
                        connect_to.device = tty;}
                void menuitem_response_speed(gchar *speed){
                        connect_to.speed = speed;}
                
        write_2_options(connect_to);
}

and use it with:

 menu = gtk_menu_new();
        menu_item0 = gtk_menu_item_new_with_label ("   9600 bps   ");
        gtk_menu_append (GTK_MENU (menu), menu_item0);
        gtk_signal_connect_object (GTK_OBJECT (menu_item0), "activate",
                GTK_SIGNAL_FUNC (menuitem_response_speed), (gpointer) g_strdup("9600"));
        gtk_widget_show (menu_item0);     
.............
............
 menu = gtk_menu_new();
        tty_item0 = gtk_menu_item_new_with_label ("   /dev/ttyS0   ");
        gtk_menu_append (GTK_MENU (menu), tty_item0);
        gtk_signal_connect_object (GTK_OBJECT (tty_item0), "activate",                          
GTK_SIGNAL_FUNC (menuitem_response_tty), (gpointer) g_strdup("/dev/ttyS0"));
        gtk_widget_show (tty_item0);

..........

but gcc returns:
gcc `gtk-config --cflags` sPPPek_notebook.c -o spppek `gtk-config --libs`
/tmp/ccIiUwE6.o: In function `main':
/tmp/ccIiUwE6.o(.text+0xf51): undefined reference to `menuitem_response_speed'
/tmp/ccIiUwE6.o(.text+0xffd): undefined reference to `menuitem_response_speed'
/tmp/ccIiUwE6.o(.text+0x10a5): undefined reference to `menuitem_response_speed'
/tmp/ccIiUwE6.o(.text+0x1152): undefined reference to `menuitem_response_speed'
/tmp/ccIiUwE6.o(.text+0x12e4): undefined reference to `menuitem_response_tty'
/tmp/ccIiUwE6.o(.text+0x1392): undefined reference to `menuitem_response_tty'
/tmp/ccIiUwE6.o(.text+0x1443): undefined reference to `menuitem_response_tty'
/tmp/ccIiUwE6.o(.text+0x14fb): undefined reference to `menuitem_response_tty'
collect2: ld returned 1 exit status
make: *** [spppek] Error 1


Im a beginer with programming and do not know how to solve this problem

Please help!!!!

_____________________________________________________________
*** http://www.Sladur.com => Zapoznanstva - Nie biahme purvi!

***** http://www.BGfree.com => Free Domain

******** http://Bogini.BGfree.com => Bogini na krasotata



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