Re: gtk 1.2 to 2.0 upgrade woes



One observation is if your using Gtk+2.0 then you should be using g_signal_connect() instead of gtk_signal_connect().

HTH,

Michael
 
On Tue, 2003-07-22 at 11:45, Rob Clack wrote:
I have done a little development using gtk 1.2.10 and have started 
looking at upgrading.  Someone installed gtk 2.0 on a networked disk I 
have access to, so I tried building my application using that.

However, having hacked through the incompatibilities, when I run my app
it crashes with a segfault in gtk_init().

I've spent hours trawling the archives looking for an example of someone
else encountering and solving this, without success, so I hope someone
can help.

Eventually I wrote a noddy app to demonstrate the problem.  The hard
bit is that as far as I'm concerned, gtk_init() is a black box.  If the
prog dies in there, I have no clue as to why.  The source might be out 
there somewhere, but I don't know where.

So first I attach the back trace output from gdb, then the source of
my noddy app.

Any help would be much appreciated.
Rob Clack


(gdb) r
Starting program: /.automount/cbi1/root/nfs/team71/acedb/rnc/play/prog

Program received signal SIGSEGV, Segmentation fault.
0x0805ea67 in ?? ()
(gdb) bt
#0  0x0805ea67 in ?? ()
#1  0x40108de5 in gtk_rc_scanner_new () from /usr/lib/libgtk-x11-2.0.so.0
#2  0x401083be in gtk_rc_scanner_new () from /usr/lib/libgtk-x11-2.0.so.0
#3  0x40107680 in gtk_rc_scanner_new () from /usr/lib/libgtk-x11-2.0.so.0
#4  0x401057da in gtk_rc_parse_string () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x4010570f in gtk_rc_get_default_files () from 
/usr/lib/libgtk-x11-2.0.so.0
#6  0x400d9061 in gtk_init_check () from /usr/lib/libgtk-x11-2.0.so.0
#7  0x400d90df in gtk_init () from /usr/lib/libgtk-x11-2.0.so.0
#8  0x08048c40 in main (argc=1, argv=0xbfffdef4) at prog.c:33
#9  0x403d21c4 in __libc_start_main () from /lib/libc.so.6
(gdb)



#include <stdio.h>
#include <gtk/gtk.h>


void Quit(GtkWidget *w, gpointer data)
{
     gtk_widget_destroy(w);
}

int main(int argc, char *argv[])
{
   GtkWidget *window, *vbox, *hbox, *sWindow;


   gtk_init(&argc, &argv);

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   vbox = gtk_vbox_new(FALSE, 1);
   gtk_container_add(GTK_CONTAINER(window), vbox);

   hbox = gtk_hbox_new(FALSE, 0);
   gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

   sWindow = gtk_scrolled_window_new(NULL, NULL);
   gtk_box_pack_start(GTK_BOX(hbox), sWindow, TRUE, TRUE, 0);

   gtk_signal_connect(GTK_OBJECT(window), "destroy",
                      GTK_SIGNAL_FUNC(Quit), NULL);

   gtk_widget_show_all(window);

   gtk_main();

   return(0);
}

Attachment: signature.asc
Description: This is a digitally signed message part



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