Can anyone build ExtensionClass.c using Borland compiler?

John Machin machin_john_888 at hotmail.com
Thu Jun 21 20:19:04 EDT 2001


"Steve S.L. Wong" <steve at hkit.net> wrote in message news:<tj4bcp85p96gb3 at news.supernews.com>...
[snip]
> But this fails:
> 
> Error: Unresolved external '__Py_DeAlloc' referenced from
> C:\PYTHON21\ZODB\ZODB\EXTENSIONCLASS\SRC\EXTENSION.OBJ

Is this an *EXACT* cut-and-paste of the error message?

C:\Python21\include>grep -i _py_dealloc *.h
object.h:extern DL_IMPORT(void) _Py_Dealloc(PyObject *);
object.h:#define _Py_Dealloc(op) ((op)->ob_type->tp_free++,
(*(op)->ob_type->tp_
dealloc)((PyObject *)(op)))
object.h:#define _Py_Dealloc(op)
(*(op)->ob_type->tp_dealloc)((PyObject *)(op))
object.h:               _Py_Dealloc((PyObject *)(op))
object.h:               _Py_Dealloc((PyObject *)(op))

===> There is no two-leading-underscores-and-capital-A function/macro
in the
include files. There is a one-leading-underscore-and-lowercase-a
variety. The extra underscore is added on the trip from .c to .obj but
Borland don't change the case of your letters! If the source actually
has 'A', then while awaiting better advice, you may like to try it
with the 'A' changed to an 'a'.

Otherwise you have a number_of_underscores problem ... sorry, can't
help, this is black magic to me.

However here's a very potent white magic spell: use the distutils kit
to build your extensions. It saves all the mucking about with weird
Borland command-line syntax, makefiles, etc. Once you've created a
'setup.py' (which itself becomes good documentation!) for each
extension, extensions just *build*.

   DOS-prompt> python setup.py build --compiler=bcpp

This is documented in the 'Installing Python Modules' manual.

Hope this helps,
John



More information about the Python-list mailing list