[Pyrex] [Cython] Installing Cython - compiling primes demo fails

Robert Bradshaw robertwb at math.washington.edu
Tue Feb 26 08:11:46 CET 2008


I don't have any experience with mingw32, but it does look like some  
kind of linking error.

However, this thread might be able to point you in the right direction:

http://osdir.com/ml/python.pyrex/2004-04/msg00028.html

- Robert


On Feb 25, 2008, at 2:58 PM, Niclas Mattsson wrote:

> Hello listers,
>
> Newbie here, trying to get Cython running on Windows XP SP2 with
> ActivePython 2.5.1.1 using mingw32-gcc. Cython itself seems to install
> correctly (no warnings or errors from "python setup.py install"), but
> building the demos fails with "undefined reference" errors when  
> linking
> primes.o. See dump below.
>
> Do I need to link to some missing library manually? What's going on?
>
> Please let me know if this is an inappropriate place for newbie
> questions - and if so, sorry for barging in!
>
> Thanks,
> Niclas
>
> -------------
>
> C:\Cython-0.9.6.12\Demos>python Setup.py build_ext --inplace -c  
> mingw32
>
> running build_ext
> building 'primes' extension
> creating build
> creating build\temp.win32-2.5
> creating build\temp.win32-2.5\Release
> c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python25\include
> -IC:\Python25\PC -c primes.c -o build\temp.win32-2.5\Release\primes.o
> primes.c: In function `__pyx_pf_6primes_primes':
> primes.c:125: warning: '__pyx_v_result' might be used uninitialized in
> this function
> writing build\temp.win32-2.5\Release\primes.def
> c:\mingw\bin\gcc.exe -mno-cygwin -shared -s
> build\temp.win32-2.5\Release\primes.o
> build\temp.win32-2.5\Release\primes.def -LC:\Python25\libs
> -LC:\Python25\PCbuild -lpython25 -lmsvcr71 -o primes.pyd
> build\temp.win32-2.5\Release\primes.o:primes.c:(.text+0x85): undefined
> reference to `_imp___Py_NoneStruct'
> build\temp.win32-2.5\Release\primes.o:primes.c:(.text+0x4c8):  
> undefined
> reference to `_imp__PyExc_RuntimeError'
> build\temp.win32-2.5\Release\primes.o:primes.c:(.text+0x559):  
> undefined
> reference to `_imp__PyString_Type'
> build\temp.win32-2.5\Release\primes.o:primes.c:(.text+0x560):  
> undefined
> reference to `_imp__PyString_Type'
> build\temp.win32-2.5\Release\primes.o:primes.c:(.text+0x81f):  
> undefined
> reference to `_imp__PyInt_Type'
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev




More information about the Pyrex mailing list