VC++ grrhhh

Gordon McMillan gmcm at hypernet.com
Thu Sep 23 13:51:54 EDT 1999


Robin Becker writes:

> anyone know how to get round nonconstant initialiser errors from
> VC++ with the construction
> 
> statichere PyTypeObject Arraytype = {
>         PyObject_HEAD_INIT(&PyType_Type) // error here
>         0,
>         "array",
> 
> when trying to compile as a separate module. Certainly
> PyType_Type is defined in another dll, but it's just an extern
> right or has M$ started fiddling with C semantics again? I have
> tried declaring as an import, but that doesn't work either. --

Actually, this is the MS trick of taking specs literally where 
everyone else lets them slide.

Either rename the file to ".cpp" or declare the pointer as NULL 
and assign it later.

- Gordon




More information about the Python-list mailing list