[SciPy-dev] Weave, numpy, external libraries and conflicting typedefs

Travis Oliphant oliphant.travis at ieee.org
Fri Jul 7 12:46:58 CDT 2006


Prabhu Ramachandran wrote:
> Hi,
>
> I have some C++ code that uses an external library (Ygl).  This
> library makes the following typedefs:
>
>     typedef signed   char    Int8;
>     typedef unsigned char   Uint8;
>     typedef signed   short   Int16;
>     typedef unsigned short  Uint16;
>     typedef signed   int     Int32;
>     typedef unsigned int    Uint32;
>     typedef          float  Float32;
>     typedef          double Float64;
>
> My C++ code is wrapped to Python and includes the header file that
> defines these typedefs.  I use weave to efficiently script this code
> from Python.
>
> Earlier, with Numeric, arrayobject.h did not define typedefs for the
> Int32 and so on.  However, numpy defines several typedefs that
> conflict with the typedefs in Ygl.
>   

You need to
#define PY_ARRAY_TYPES_PREFIX ygl_

or something like that before including arrayobject.h

-Travis



More information about the Scipy-dev mailing list