Am 09.11.2011 20:38, schrieb Juan Declet-Barreto: > I am using Cygwin build of Python2.6. This Cygwin install has both a Cygwin > gcc (versions 3.4.4 and 4.5.3) and mingw32 (3.4.4), as listed in lib/gcc/. > > I also tried the mingw32 shell separately, but I get the same results even > when I pass the "-c mingw32" option. > > The error is reproduced below: > > $ python setup.py build > running build > running build_py > running build_ext > building 'guppy.sets.setsc' extension > gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes > -I/usr/include/python2.6 -c src/sets/sets.c -o > build/temp.cygwin-1.7.9-i686-2.6/src/sets/sets.o > src/sets/sets.c:68:5: error: initializer element is not constant > src/sets/sets.c:68:5: error: (near initialization for > `nysets_heapdefs[0].type') > src/sets/sets.c:69:5: error: initializer element is not constant > src/sets/sets.c:69:5: error: (near initialization for > `nysets_heapdefs[1].type') > src/sets/sets.c:70:5: error: initializer element is not constant > src/sets/sets.c:70:5: error: (near initialization for > `nysets_heapdefs[2].type') > > error: command 'gcc' failed with exit status 1
static NyHeapDef nysets_heapdefs[] = { {0, 0, (NyHeapDef_SizeGetter) mutbitset_indisize}, {0, 0, 0, cplbitset_traverse}, {0, 0, nodeset_indisize, nodeset_traverse, nodeset_relate}, {0} }; nysets_heapdefs[0].type = &NyMutBitSet_Type; nysets_heapdefs[1].type = &NyCplBitSet_Type; nysets_heapdefs[2].type = &NyNodeSet_Type; The code looks fine to me and compiles with GCC 4.6. It seems your GCC chokes on "nysets_heapdefs[0].type = &NyMutBitSet_Type;". It's not a file local static but an extern declaration. Are you sure that you are using a recent version of GCC 4.x? I had some issues with GCC 3.x in the past. Cygwin has GCC 3.x as default gcc. For Python 2.6 you can use the free VS 2008 Express version. I've compiled guppy for 32bit Python 2.7 a couple of days ago w/o any issue -- http://mail.python.org/mailman/listinfo/python-list