[Numpy-discussion] NPY_DOUBLE not declared

Florian Lindner mailinglists at xgm.de
Mon Aug 17 07:11:43 EDT 2015


Hello,

I try to converse a piece of C code to the new NumPy API to get rid of the 
deprecation warning.

#warning "Using deprecated NumPy API, disable it by " "#defining 
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

As a first step I replaced arrayobject.h by numpy/npy_math.h:

#include <Python.h>
#include <numpy/npy_math.h>

But this gives errors that NPY_DOUBLE is not declared.

http://docs.scipy.org/doc/numpy/reference/c-api.dtype.html#c.NPY_DOUBLE 
gives no information where NPY_DOUBLE is declared, so I used the standard 
npy_math.h header.

src/action/PythonAction.cpp:90:51: error: 'NPY_DOUBLE' was not declared in 
this scope
           PyArray_SimpleNewFromData(1, sourceDim, NPY_DOUBLE, 
sourceValues);


Including numpy/npy_common.h does not change it either.

Thanks,
Florian




More information about the NumPy-Discussion mailing list