|
From: Sasha <nd...@ma...> - 2006-01-27 22:50:32
|
On 1/27/06, David M. Cooke <co...@ph...> wrote:
> You need to add #include "Python.h" as the first include (and add a
> -I<python include directory> to your gcc line, of course).
Still does not work
> cat test.c
#define PY_ARRAY_TYPES_PREFIX XYZ_
#include <Python.h>
#include <numpy/arrayobject.h>
> gcc -I Python-2.4.1/include/python2.4 -I lib/python2.4/site-packages/nump=
y/core/include -c test.c
In file included from
lib/python2.4/site-packages/numpy/core/include/numpy/arrayobject.h:1346,
from test.c:3:
lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:
In function `import_array':
lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:765=
:
parse error before ')' token
lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:765=
:
parse error before ')' token
lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:
At top level:
lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:771=
:
parse error before "return"
If I remove #define PY_ARRAY_TYPES_PREFIX or define it as nothing,
compilation works.
The RPy.h header I was trying to compile in the first plase includes
numpy/arrayobject.h after
Python.h .
|