Python - Boost - Cygwin linker error

Jason Tishler jason at tishler.net
Mon Nov 25 10:05:42 EST 2002


Stéphane,

On Sat, Nov 23, 2002 at 07:42:28PM -0800, Stéphane Vaxelaire wrote:
> I get an error at link time that appears to occur between Boost code
> and python lib. Here is the output :
> 
> boost/libboost_python.a(extension_class.o)(.text+0x33a2): In function
> `operator_dispatcher_call_pow':
> /home/Steph/vegastrike/src/boost/extension_class.cpp:558: variable
> '_Py_NoneStruct' can't be auto-imported. Please read the documentation
> for ld's --enable-auto-import for details.
> Info: resolving _PyInt_Type by linking to __imp__PyInt_Type
> (auto-import)
> Info: resolving _PyLong_Type by linking to __imp__PyLong_Type
> (auto-import)
> Info: resolving _PyFloat_Type by linking to __imp__PyFloat_Type
> (auto-import)
> ... (there are a few other Info things ...
> 
> [snip]
> 
> Anyone can help me with this _Py_NoneStruct thing ?

The above can be solved by compiling the code that refers to
_Py_NoneStruct with -DUSE_DL_IMPORT.  This will cause _Py_NoneStruct to
be declared so that it can be imported (without auto-import) from the
Cygwin Python import library.

Note that this occurs automatically for Distutils built shared
extensions.  If Boost.Python is built using a different mechanism,
then -DUSE_DL_IMPORT will have to be specified manually.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6





More information about the Python-list mailing list