[XML-SIG] PyXML-0.7.1 expat ext. build failed under sygwin

Dmitry Tikhostup dm_top@hotmail.com
Fri, 21 Jun 2002 06:03:10 +0800


I need the XML SAX parser for Python under Cygwin.


*Windows 2000 Prof.
*CygWin ver.:
*GCC ver.:     2.95.3-5
    Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
    gcc version 2.95.3-5 (cygwin special)
*Python ver.:  2.2.1
    $ python
    Python 2.2.1 (#1, Jun  6 2002, 16:53:43)
    [GCC 2.95.3-5 (cygwin special)] on cygwin

Description of the problem:

After unpacking of the tarball, the issuing the python setup.py build
cause the following compiling error during building the expat extention:

. -- copying ---
copying xml/xslt/_4xslt.py -> build/lib.cygwin-1.3.10-i686-2.2/_xmlplus/xslt
copying xml/xslt/__init__.py -> 
running build_ext
building '_xmlplus.parsers.pyexpat' extension
creating build/temp.cygwin-1.3.10-i686-2.2
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_DL_IMPORT -DHAVE_EXPAT_H 
024 -Iextensions/expat/lib -I/usr/local/include/python2.2 -c 
c -o build/temp.cygwin-1.3.10-i686-2.2/pyexpat.o
extensions/pyexpat.c:1709: initializer element is not constant
extensions/pyexpat.c:1709: (near initialization for 
extensions/pyexpat.c:1712: initializer element is not constant
extensions/pyexpat.c:1712: (near initialization for 
extensions/pyexpat.c:1715: initializer element is not constant
extensions/pyexpat.c:1715: (near initialization for 
extensions/pyexpat.c:1718: initializer element is not constant
extensions/pyexpat.c:1718: (near initialization for 
extensions/pyexpat.c:1727: initializer element is not constant
extensions/pyexpat.c:1727: (near initialization for 
extensions/pyexpat.c:1736: initializer element is not constant
extensions/pyexpat.c:1736: (near initialization for 
extensions/pyexpat.c:1739: initializer element is not constant
extensions/pyexpat.c:1739: (near initialization for 
extensions/pyexpat.c:1742: initializer element is not constant
extensions/pyexpat.c:1742: (near initialization for 
extensions/pyexpat.c:1745: initializer element is not constant
extensions/pyexpat.c:1745: (near initialization for 
extensions/pyexpat.c:1754: initializer element is not constant
extensions/pyexpat.c:1754: (near initialization for 
extensions/pyexpat.c:1757: initializer element is not constant
extensions/pyexpat.c:1757: (near initialization for 
extensions/pyexpat.c:1760: initializer element is not constant
extensions/pyexpat.c:1760: (near initialization for 
extensions/pyexpat.c:1763: initializer element is not constant
extensions/pyexpat.c:1763: (near initialization for 
error: command 'gcc' failed with exit status 1


the simple code review and primitive test like:
void funcA(int a, int b)
  printf("from A: %d, %d\n", a, b);

void funcB(int a, int b)
  printf("from B: %d, %d\n", a, b);

typedef void (*PF)(int, int);

struct S {
  const char * _F;
  PF           _pf;

extern struct S ars[2];

static struct S ars[] =
    {"funcA", funcA },
    {"funcB", funcB },

int main()
  printf("%s ", ars[0]._F);
  ars[0]._pf(1, 2);
  printf("%s ", ars[1]._F);
  ars[1]._pf(3, 4);

  return 0;

$ gcc -o test main.c

shows that everything should be all right. But it is not...

Searching the net:
1. I did not find the precompiled version of the PyXML for cygwin.
   Could you build and put on the site the precomiled version for the cygwin 
as well? I believe that cygwin's rpm would be more then enough.
2. The problem like "initializer element is not constant" is shown but the 
recommendations goes to the updating of the gcc compiler with unclear 
direction. That's possibly true, but instalation of the GNU's projects under 
cygwin is a different story.

With the best regards,
  Dmitri Tikhostoup
  e-mail: dm_top@hotmail.com

Chat with friends online, try MSN Messenger: http://messenger.msn.com