I was trying to wrap a function in glib using pygtk. When I try to
import the module produced, I got this error:

ImportError: ./glibmodule.so: undefined symbol: _PyGObject_API

After spent a whole day trying to figure out what's going on, I 
finally found that in my glibmodule.c file, I have

#include <Python.h>
#include <pygtk/pygtk.h>
#include <pygobject.h>

This cause problem because the pygobject.h is included after
pygtk/pygtk.h. Once the order of the 2 lines were switched, the module
was imported successfully. I don't know if this should be considered as
a bug, I just send this mail as a reminder to people who might come
across the same problem when using pygtk in the future.


-- 
Best regard
hashao
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to