[Pyrex] Undefined references message when compiling

stephen at theboulets.net stephen at theboulets.net
Thu May 17 18:17:38 UTC 2007


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.

Stephen

D:\Data\csb046\programming\python\pyrex>gcc pyrex_ex1.c -o pyrex_ex1.o
C:/TEMP/ccEhcaaa.o(.text+0x50):pyrex_ex1.c: undefined reference to
`_imp__PyArg_ParseTupleAndKeywords'
C:/TEMP/ccEhcaaa.o(.text+0x6a):pyrex_ex1.c: undefined reference to
`_imp___Py_NoneStruct'
C:/TEMP/ccEhcaaa.o(.text+0x75):pyrex_ex1.c: undefined reference to
`_imp___Py_NoneStruct'
C:/TEMP/ccEhcaaa.o(.text+0x83):pyrex_ex1.c: undefined reference to
`_imp__PyList_New'
C:/TEMP/ccEhcaaa.o(.text+0x1eb):pyrex_ex1.c: undefined reference to
`_imp__PyObject_GetAttr'
C:/TEMP/ccEhcaaa.o(.text+0x222):pyrex_ex1.c: undefined reference to
`_imp__PyInt_FromLong'
C:/TEMP/ccEhcaaa.o(.text+0x25a):pyrex_ex1.c: undefined reference to
`_imp__PyTuple_New'
C:/TEMP/ccEhcaaa.o(.text+0x2b7):pyrex_ex1.c: undefined reference to
`_imp__PyObject_CallObject'
C:/TEMP/ccEhcaaa.o(.text+0x4b0):pyrex_ex1.c: undefined reference to
`_imp__Py_InitModule4'
C:/TEMP/ccEhcaaa.o(.text+0x4e7):pyrex_ex1.c: undefined reference to
`_imp__PyImport_AddModule'
C:/TEMP/ccEhcaaa.o(.text+0x52d):pyrex_ex1.c: undefined reference to
`_imp__PyObject_SetAttrString'
C:/TEMP/ccEhcaaa.o(.text+0x5aa):pyrex_ex1.c: undefined reference to
`_imp__PyString_InternFromString'
C:/TEMP/ccEhcaaa.o(.text+0x61e):pyrex_ex1.c: undefined reference to
`_imp__PyString_FromString'
C:/TEMP/ccEhcaaa.o(.text+0x639):pyrex_ex1.c: undefined reference to
`_imp__PyString_FromString'
C:/TEMP/ccEhcaaa.o(.text+0x656):pyrex_ex1.c: undefined reference to
`_imp__PyModule_GetDict'
C:/TEMP/ccEhcaaa.o(.text+0x672):pyrex_ex1.c: undefined reference to
`_imp__PyTuple_New'
C:/TEMP/ccEhcaaa.o(.text+0x68e):pyrex_ex1.c: undefined reference to
`_imp__PyString_FromString'
C:/TEMP/ccEhcaaa.o(.text+0x70a):pyrex_ex1.c: undefined reference to
`_imp__PyCode_New'
C:/TEMP/ccEhcaaa.o(.text+0x71c):pyrex_ex1.c: undefined reference to
`_imp__PyThreadState_Get'
C:/TEMP/ccEhcaaa.o(.text+0x73e):pyrex_ex1.c: undefined reference to
`_imp__PyFrame_New'
C:/TEMP/ccEhcaaa.o(.text+0x761):pyrex_ex1.c: undefined reference to
`_imp__PyTraceBack_Here'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o)(.text+0x106):main.c:
undefined reference to `WinMain at 16'
collect2: ld returned 1 exit status




More information about the Pyrex mailing list