Mailing List Archive

pyexpat.c help
Hello,

I'm trying to get ParsedXML to work in Zope 2.4.1 with Python 2.1. At
the ParsedXML site at zope.org, there is a zipe file with the VC++
project file to build pyexpat.pyd. I get this error when building:

Creating library Debug/pyexpat.lib and object Debug/pyexpat.exp
pyexpat.obj : error LNK2001: unresolved external symbol __Py_Dealloc
pyexpat.obj : error LNK2001: unresolved external symbol __Py_RefTotal
pyexpat.obj : error LNK2001: unresolved external symbol __Py_NoneStruct
pyexpat.obj : error LNK2001: unresolved external symbol _PyExc_IOError
pyexpat.obj : error LNK2001: unresolved external symbol _PyExc_TypeError
pyexpat.obj : error LNK2001: unresolved external symbol _PyFile_Type
pyexpat.obj : error LNK2001: unresolved external symbol
_PyExc_ValueError
pyexpat.obj : error LNK2001: unresolved external symbol _PyString_Type
pyexpat.obj : error LNK2001: unresolved external symbol
_PyExc_AttributeError
pyexpat.obj : error LNK2001: unresolved external symbol
_PyExc_RuntimeError
pyexpat.obj : error LNK2001: unresolved external symbol
_Py_InitModule4TraceRefs
pyexpat.obj : error LNK2001: unresolved external symbol _PyType_Type
../pyexpat.pyd : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.

pyexpat.pyd - 13 error(s), 0 warning(s)

Is this .c written for python1.5 only? I put py2.1 files in the
include/lib path. Do I need a ver made to compile with 2.1? Also, what
is pyexpat.pyd's role in zope (what does it do/used for)? ANY help
would be very much appreciated; I've been trying for hours to make it
work...

Thanks in advance,
Brian W.
Re: pyexpat.c help [ In reply to ]
Hey,

I've sent a cc of this reply to the ParsedXML-dev and Fred Drake. Fred
hopes to start looking at the parser issues next week.

Watson, Brian wrote:
> I'm trying to get ParsedXML to work in Zope 2.4.1 with Python 2.1. At
> the ParsedXML site at zope.org, there is a zipe file with the VC++
> project file to build pyexpat.pyd. I get this error when building:
>
> Creating library Debug/pyexpat.lib and object Debug/pyexpat.exp
> pyexpat.obj : error LNK2001: unresolved external symbol __Py_Dealloc
> pyexpat.obj : error LNK2001: unresolved external symbol __Py_RefTotal
> pyexpat.obj : error LNK2001: unresolved external symbol __Py_NoneStruct
> pyexpat.obj : error LNK2001: unresolved external symbol _PyExc_IOError
> pyexpat.obj : error LNK2001: unresolved external symbol _PyExc_TypeError
> pyexpat.obj : error LNK2001: unresolved external symbol _PyFile_Type
> pyexpat.obj : error LNK2001: unresolved external symbol
> _PyExc_ValueError
> pyexpat.obj : error LNK2001: unresolved external symbol _PyString_Type
> pyexpat.obj : error LNK2001: unresolved external symbol
> _PyExc_AttributeError
> pyexpat.obj : error LNK2001: unresolved external symbol
> _PyExc_RuntimeError
> pyexpat.obj : error LNK2001: unresolved external symbol
> _Py_InitModule4TraceRefs
> pyexpat.obj : error LNK2001: unresolved external symbol _PyType_Type
> ../pyexpat.pyd : fatal error LNK1120: 12 unresolved externals
> Error executing link.exe.
>
> pyexpat.pyd - 13 error(s), 0 warning(s)
>
> Is this .c written for python1.5 only? I put py2.1 files in the
> include/lib path. Do I need a ver made to compile with 2.1? Also, what
> is pyexpat.pyd's role in zope (what does it do/used for)?

It's used by ParsedXML itself to do its parsing (translating the raw
XML data into a DOM tree). I'm not entirely sure
why we can't use Python 2.1's expat, but it seems it may miss some
features that ParsedXML needs (and some Python builds apparently don't
come with it at all).

> ANY help
> would be very much appreciated; I've been trying for hours to make it
> work...

Weird; it does compile for Python 2.1 on Linux so I'm at a loss why it
wouldn't compile under Windows. However, even on Linux the compiled
pyexpat seems to trigger segfault errors in the parser test suite, so
something is still wrong (but some limited testing showed the expat
that comes with Python 2.1 *also* suffers these problems..)

I have no experience with compilation on Windows however. I do have an
interest in seeing a Windows binary version of ParsedXML for Zope 2.4,
so I hope we can figure it out..

Regards,

Martijn