[Pyrex] Undefined references message when compiling

Robert Kern robert.kern at gmail.com
Thu May 17 18:41:02 UTC 2007


stephen at theboulets.net wrote:
> Sorry for the newbie-ish question. I'm trying to compile the
> 
> I have Mingw installed on windows and the Python 2.5 from python.org. I
> generated a c-file by cutting and pasting the 'calculate prime numbers'
> example on the home page. I changed the c-file by making my #includes
> point to my python distribution: #include "C:\Python25\include\Python.h".
> 
> I get this error when I try to compile. Can someone tell me how to resolve
> this? Thanks.

Use distutils to build your extension module. Don't try to compile it by hand.
Don't hardcode the path to Python.h.

  http://docs.python.org/dist/dist.html
  http://docs.python.org/dist/single-ext.html
  http://docs.python.org/inst/inst.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Pyrex mailing list