[pygtk] (no subject)

Manne Tallmarken mannet at kth.se
Mon May 21 17:00:10 WST 2012


Helly guys,

I am trying to run a simple test program, however, it segfaults:

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

int main(int argc, char **argv)
{
    gdk_init(&argc, &argv);
    
    GtkWidget *test = gtk_button_new();

    PyObject *p = pygobject_new ((GObject *) test);

    printf("%p\n", p);

    return 0;
}

$ gcc -std=c99 -Wall `pkg-config --cflags --libs gtk+-2.0` -I/usr/include/python2.7 -I/usr/include/pygtk-2.0 -o debug debug.c && ./debug
zsh: segmentation fault  ./debug

If I remove the line containing pygobject_new it works. What am I doing wrong?

$ uname -a
Linux helix 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011 x86_64 GNU/Linux

$ cat /etc/issue
Debian GNU/Linux wheezy/sid

$ dpkg -l python2.7-dev|grep python                 
ii  python2.7-dev                         2.7.3~rc2-2.1                   Header files and a static library for Python (v2.7)

$ dpkg -l python-gobject-2-dev|grep python
ii  python-gobject-2-dev                  2.28.6-10                    development headers for the static GObject Python bindings

Best regards,
Manne Tallmarken


More information about the pygtk mailing list