Fwd: [Numpy-discussion] Numpy does not compile with PY_ARRAY_TYPES_PREFIX

David M. Cooke cookedm at physics.mcmaster.ca
Fri Jan 27 13:38:06 CST 2006

Sasha <ndarray at mac.com> writes:

> On 1/27/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
>> Show an example of using it in a file before you include the numpy
>> header.  Because that *should* work.  I know, I just tested it a few
>> days ago...
> I've tried to put just two lines in "test.c":
> #include <numpy/arrayobject.h>
> and compile it with
> $ gcc -I$NUMPYINCLUDE -c test.c
> Where NUMPYINCLUDE points to the location of numpy/arrayobject.h

You need to add #include "Python.h" as the first include (and add a
-I<python include directory> to your gcc line, of course).

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the Numpy-discussion mailing list