This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: Problem building python extensions
- To: "'Darrell R. Hougen'" <no dot darrell dot r dot hougen dot spam at lmco dot com>, <cygwin at cygwin dot com>
- Subject: RE: Problem building python extensions
- From: "Norman Vine" <nhv at cape dot com>
- Date: Wed, 26 Sep 2001 14:57:57 -0400
- Cc: <darrell dot r dot hougen at lmco dot com>
- Reply-To: <nhv at cape dot com>
Darrell R. Hougen writes:
>
>Unfortunately, I am still having problems. Norman, I followed your
suggestion of using a
>version of python that is built under cygwin. I downloaded python-2.1.1
and Numpy
>20.2.1. Both built fine under my installation of cygwin.
:-)
>However,
>when I attempt to compile my
>code, I get the following error:
>
>$ make
>gcc -g -Wall -Wshadow -DUSE_DL_IMPORT -I.
>-I/usr/local/include/Python2.1
>-I/usr/local/include/Python2.1/Numeric -c -o Term.o Term.c
>Term.c:429: initializer element is not constant
>Term.c:429: (near initialization for `TermObjectType.ob_type')
>make: *** [Term.o] Error 1
>
>This is where ob_type is initialized with &PyType_Type, so the
>error is very similar to
>the one I was seeing before, i.e., the variable is not yet defined.
With out seeing the actual code all I can do is guess the probelm
however try changing the line
PyObject_HEAD_INIT(&PyType_Type)
to
PyObject_HEAD_INIT(NULL)
and then in your modules main initialization routine
maybe init_term() ?
add at the top of that function
TermObjectType.ob_type = &PyType_Type;
you can use any of the files in the modules directory
to see how this is done for other extension types.
If you still are having problems if you mail me < not the list >
a link to or the src file itself I can see what I can do for you.
Oh you probally will need change the signature of the main_init()
function from void to DL_EXPORT(void)
Cheers
Norman
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/