compile pycrypto on windows

H

Haim Ashkenazi

Hi

I'm trying to compile pycrypto on windows. I've installed mingw and try to
run the command 'python setup.py build -c mingw32 install' and I get this
error:

$ python setup.py build -c mingw32 install
running build
running build_py
creating build
creating build\lib.win32-2.3
creating build\lib.win32-2.3\Crypto
copying .\test.py -> build\lib.win32-2.3\Crypto
copying .\__init__.py -> build\lib.win32-2.3\Crypto
creating build\lib.win32-2.3\Crypto\Hash
copying .\Hash\HMAC.py -> build\lib.win32-2.3\Crypto\Hash
copying .\Hash\MD5.py -> build\lib.win32-2.3\Crypto\Hash
copying .\Hash\SHA.py -> build\lib.win32-2.3\Crypto\Hash
copying .\Hash\__init__.py -> build\lib.win32-2.3\Crypto\Hash
creating build\lib.win32-2.3\Crypto\Cipher
copying .\Cipher\__init__.py -> build\lib.win32-2.3\Crypto\Cipher
creating build\lib.win32-2.3\Crypto\Util
copying .\Util\number.py -> build\lib.win32-2.3\Crypto\Util
copying .\Util\randpool.py -> build\lib.win32-2.3\Crypto\Util
copying .\Util\RFC1751.py -> build\lib.win32-2.3\Crypto\Util
copying .\Util\test.py -> build\lib.win32-2.3\Crypto\Util
copying .\Util\__init__.py -> build\lib.win32-2.3\Crypto\Util
creating build\lib.win32-2.3\Crypto\Protocol
copying .\Protocol\AllOrNothing.py -> build\lib.win32-2.3\Crypto\Protocol
copying .\Protocol\Chaffing.py -> build\lib.win32-2.3\Crypto\Protocol
copying .\Protocol\__init__.py -> build\lib.win32-2.3\Crypto\Protocol
creating build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\DSA.py -> build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\ElGamal.py -> build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\pubkey.py -> build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\qNEW.py -> build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\RSA.py -> build\lib.win32-2.3\Crypto\PublicKey
copying .\PublicKey\__init__.py -> build\lib.win32-2.3\Crypto\PublicKey
running build_ext
building 'Crypto.Hash.MD2' extension
creating build\temp.win32-2.3
creating build\temp.win32-2.3\Release
creating build\temp.win32-2.3\Release\src
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Isrc/ -Ic:\Python23\include
-Ic:\Python23\PC -c src/MD2.c -o build\temp.win32-2.3\Release\src\md2.o
writing build\temp.win32-2.3\Release\src\MD2.def
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.3\Release\sr
\md2/o build\temp.win32-2.3\Release\src\MD2.def -Lc:\Python23\libs -Lc
\Python23\PCBuild -lpython23 -o build\lib.win32-2.3\Crypto\Hash\MD2.pyd
build\temp.win32-2.3\Release\src\md2.o(.text+0x3e3):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x3eb):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x53c):MD2.c: undefined
reference to `_imp__PyType_Type'
 
R

ralf

Haim Ashkenazi said:
Hi

I'm trying to compile pycrypto on windows. I've installed mingw and try to
run the command 'python setup.py build -c mingw32 install' and I get this
error:

$ python setup.py build -c mingw32 install
running build
running build_py [snip]
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.3\Release\sr
\md2/o build\temp.win32-2.3\Release\src\MD2.def -Lc:\Python23\libs -Lc
\Python23\PCBuild -lpython23 -o build\lib.win32-2.3\Crypto\Hash\MD2.pyd
build\temp.win32-2.3\Release\src\md2.o(.text+0x3e3):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x3eb):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x53c):MD2.c: undefined
reference to `_imp__PyType_Type'

Did you create libpythonXX.a ?
http://sebsauvage.net/python/mingw.html describes how to do that.
 
H

Haim Ashkenazi

Haim Ashkenazi said:
Hi

I'm trying to compile pycrypto on windows. I've installed mingw and try
to run the command 'python setup.py build -c mingw32 install' and I get
this error:

$ python setup.py build -c mingw32 install
running build
running build_py [snip]
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win32-2.3\Release\sr \md2/o
build\temp.win32-2.3\Release\src\MD2.def -Lc:\Python23\libs -Lc
\Python23\PCBuild -lpython23 -o build\lib.win32-2.3\Crypto\Hash\MD2.pyd
build\temp.win32-2.3\Release\src\md2.o(.text+0x3e3):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x3eb):MD2.c: undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.3\Release\src\md2.o(.text+0x53c):MD2.c: undefined
reference to `_imp__PyType_Type' ---

can someone please help?

Did you create libpythonXX.a ?
http://sebsauvage.net/python/mingw.html describes how to do that.
thanx, that solved it.

Bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top