I just went and looked at my code (its a plugin for SciGraphica).
I DO NOT define NO_IMPORT and this causes your missing symbol to be
defined in pygtk.h. As for init_pygtk, I never call it! But I'm importing
gtk prior to loading my module.

Mathew
> 
> We are creating a shared library, with -shared.  Python still won't
> load a shared library with an undefined symbol in it.  Are we doing
> something dumb?  The C++ code contains
> 
> #define NO_IMPORT_PYGTK
> #include <pygtk.h>
> #undef NO_IMPORT_PYGTK
> 
> and (later, within a canvas item callback)
> 
>     PyGtk_BlockThreads();
>     PyObject *result = PyEval_CallObject(pycallback, args);
>     PyGtk_UnblockThreads();
> 
> When compiled into a shared library, python says
> 
> ImportError: /u/home3/langer/FE/OOF2/INTEL/oofcppcmodule.so: undefined
>    symbol: _PyGtk_API
> 
> If I add my own pointer to _PyGtk_API and call the (slightly modified)
> init_pygtk macro, then it all works.  As I said, this feels wrong to
> me.  It looks like there's no harm in calling init_pygtk an extra
> time, but I'd rather not have to copy names like _PyGtk_API out of the
> nominally private parts of the header file...
> 
>  -- Steve
> 
> 
> -- 
> /* EMail: [EMAIL PROTECTED] ------------------ Phone: (301) 975-5423 --
> -- WWW:  http://math.nist.gov/~SLanger/ ------------ Fax:   (301) 990-4127 --
> -- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, MD  20899-8910 */
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


_______________________________________________
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