Re: Statically linked GTK app



Raymond Wan writes:
 > 
 > Hi all,
 > 
 > 	Thanks to John, Christian, and Havoc for their replies.  I've
 > tried a few things and I'm not quite sure whether I'm further or closer
 > than I was before.  I installed gtk 1.3.10 using the arguments mentioned
 > below, except that I didn't install gtkfb and used --with-included-loaders
 > with pango.
 > 
 > 	Compilation worked and the dynamically linked version still works
 > fine.  But, the statically linked version gives a different runtime error
 > now and I'm not sure if this is because of something I coded or something
 > with compiling.  The runtime error is: 
 > 
 > =====
 > (process:31820): GRuntime-CRITICAL **:
 > gtype.c:1824:g_type_register_static(): initialization assertion failed,
 > use g_type_init() prior to this function
 > 
 > (process:31820): GRuntime-CRITICAL **: file gobject.c: line 588
 > (g_object_new): assertion `G_TYPE_IS_OBJECT (object_type)' failed
 > Segmentation fault (core dumped)
 > =====
 > 
 > 	When I run it through gdb with --g-fatal-warnings and do a
 > backtrace, I get this:
 > 
 > #3  0x81412b4 in gdk_pixbuf_new_from_xpm_data (data=0x83b5168)
 >     at gdk-pixbuf-io.c:651
 > 651             pixbuf = (* load_xpm_data) (data);
 > (gdb) up
 > #4  0x811603f in gdk_pixmap_colormap_create_from_xpm_d (window=0x0, 
 >     colormap=0x87c81c8, mask=0xbffff8c8, transparent_color=0x0,
 > data=0x83b5168)
 >     at gdkpixmap.c:557
 > 557       pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)data);
 > 
 > 	and that's caused by:
 > 

Hi, just to notes:

*) you have to call 

gdk_rgb_init();

if you want to use the gdkpixbuf rgb renderer (but I think you are
using X one)

*) window=0x0 from your stack trace ....  if you look at the code in gdkpixmap.c


gdk_pixmap_colormap_create_from_xpm_d (GdkWindow  *window,
                                       GdkColormap *colormap,
                                       GdkBitmap **mask,
                                       GdkColor   *transparent_color,
                                       gchar     **data)
{
  GdkPixbuf *pixbuf;
  GdkPixmap *pixmap;

  g_return_val_if_fail (window != NULL || colormap != NULL, NULL);
  g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
  g_return_val_if_fail (colormap == NULL || GDK_IS_COLORMAP (colormap), NULL);

the function dies if window is NULL .... so I think the real problem
is that window is just NULL .... may you check what happens to all_windows ->
phrase_window[0] -> window ?

Bye!



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