2011-08-08 41 views
7

Windows 7 x64 üzerinde Cython'u yüklemekle uğraşıyorum. automated MinGW installer'u indirip yükledim. Aşağıdaki içeriğe sahip distutils klasörüne bir distutils.cfg oluşturuldu:Cython, Windows 7 x64 üzerinde derleyemez x64

[build] 
compiler = mingw32 

ortam değişkenlerine C:\MinGW\bin ekledikten sonra, ben easy_install Cython denilen ama aşağıdaki hataları olsun. Internet Raping gerçekten bana tüm bu derleme şeyler (ya da ben sh * t diyelim?) bana çok yeni gibi yararlı resulsts vermedi.

c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5d59): undefined reference to `_imp__PyObject_GetAttr' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5dc5): undefined reference to `_imp__PyObject_GetAttr' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5e31): undefined reference to `_imp__PyObject_GetAttr' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5ebc): undefined reference to `_imp__PyObject_Call' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5f08): undefined reference to `_imp__PyDict_New' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5f49): undefined reference to `_imp__PyObject_SetAttr' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5ffe): undefined reference to `_imp__PyErr_Occurred' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x6013): undefined reference to `_imp__PyExc_ImportError' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x601e): undefined reference to `_imp__PyErr_SetString' 
c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x602d): undefined reference to `_imp__PyInt_FromLong' 
collect2: ld returned 1 exit status 
dllwrap: gcc exited with status 1 
error: Setup script exited with error: command 'dllwrap' failed with exit status 1 

Herhangi bir fikir yanlış mı? Teşekkürler !

GÜNCELLEME: Ben libpython27.a oluşturmak için dlltools kullanılan ve yeniden Cython inşa etmeye çalıştı ve gayet güzel çalıştı! Ben Pythonx64 ama mingw32 derleyici kullanmak nedeni budur varsayalım

ImportError: DLL load failed, %1 is not a valid Win32-executable. 

: Ama şimdi, cython.exe çağırarak bu hatayı verir? Peki, x64 için nasıl derleyebilirim?

+0

@lance Ne değiştirdiniz? // ah başlık. –

+1

Başlık. Yukarıdaki benim avatarımın üstünde "düzenlenmiş" kelimesinden hemen sonra görünen "X dakika önce" metnini tıklayarak revizyon düzenlemelerinin bir özetini görebilirsiniz. – lance

+1

Awesome, bunu bilmiyordum xD Teşekkürler –

cevap

10

Önceden Derlenmiş Cython paketleri var on this site. X86 Python'a geçmenizi öneririm, x64 sürümünü kullanarak gerçek bir avantaj elde edemezsiniz. X64 ile sopa yapmak istiyorsanız, MingW'yi kullanamazsınız ve MS SDK C++ derleyicisini (more on this) kullanmanız gerekir.

Do not use MinGW-w64. As you will notice, the MinGW import library for Python (e.g. libpython27.a) is omitted from the AMD64 version of Python. This is deliberate. Do not try to make one using dlltool. [...] There have also been issues with the mingw runtime conflicting with the MSVC runtime; this can happen from places you don't expect, such as inside runtime libraries for g++ or gfortran.

@lance
+1

+1, x86'ya geçiş yaptı. Teşekkür ederim ! –

İlgili konular