[pyOpenSSL] Building PyOpenSSL for Windows

Michael Foord mike at pcblokes.com
Wed Feb 16 15:02:25 CET 2005


Hello,

I'm attempting to build PyOpenSSL for windows.

I'm currently attempting with mingw32 and Python2.3 - although I'd also 
like to do it with Python 2.4 and the windows optimising compiler. (Both 
windows XP)

I'm currently struggling !
Using 'pyOpenSSL-0.6' source from Sourceforge and the windows prebuilt 
binaries for OpenSSL 0.9.7e.

The 'install' file with pyOpenSSL says :

Building the library:

    setup.py build_ext -I ...\openssl\inc32 -L ...\openssl\out32dll
    setup.py build
(to which I had -cmingw32 to make distutils use gcc from mingw32)
My opensssl installation has neither an inc32 directory, nor an out32dll 
file/directory.

There is an `C:\OpenSSL\include\openssl` directory  - with all the '.h' 
and '.c' files. There is also a directory 'C:\OpenSSL\lib\MinGW' with 
all the '.a' and '.def' files.

I guessed at the following command line order - which failed with the 
following messages. Does anyone have any clues (or can point me to 
resources/prebuilt binaries) ? It fails with a 'no such file' error as 
the first error, yet that file exists in the openssl directory. I guess 
the rest of the errors relate to it not finding the include file.

D:\Downloads\pyOpenSSL-0.6>setup.py build_ext -I 
C:\OpenSSL\include\openssl -L C
:\OpenSSL\lib\MinGW -cmingw32
running build_ext
building 'OpenSSL.crypto' extension
creating build
creating build\temp.win32-2.3
creating build\temp.win32-2.3\Release
creating build\temp.win32-2.3\Release\src
creating build\temp.win32-2.3\Release\src\crypto
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall 
-IC:\OpenSSL\include\openssl -IC
:\Python23\include -IC:\Python23\PC -c src/crypto/crypto.c -o 
build\temp.win32-2
.3\Release\src\crypto\crypto.o
In file included from src/crypto/crypto.h:17,
                 from src/crypto/crypto.c:13:
src/crypto/x509.h:17:25: openssl/ssl.h: No such file or directory
In file included from src/crypto/crypto.h:17,
                 from src/crypto/crypto.c:13:
src/crypto/x509.h:27: error: syntax error before "X509"
src/crypto/x509.h:27: warning: no semicolon at end of struct or union
src/crypto/x509.h:29: error: syntax error before '}' token
src/crypto/x509.h:29: warning: type defaults to `int' in declaration of 
`crypto_
X509Obj'
src/crypto/x509.h:29: warning: data definition has no type or storage class
In file included from src/crypto/crypto.h:18,
                 from src/crypto/crypto.c:13:
src/crypto/x509name.h:27: error: syntax error before "X509_NAME"
src/crypto/x509name.h:27: warning: no semicolon at end of struct or union
src/crypto/x509name.h:30: error: syntax error before '}' token
src/crypto/x509name.h:30: warning: type defaults to `int' in declaration 
of `cry
pto_X509NameObj'
src/crypto/x509name.h:30: warning: data definition has no type or 
storage class
In file included from src/crypto/crypto.h:19,
                 from src/crypto/crypto.c:13:
src/crypto/netscape_spki.h:24: error: syntax error before "NETSCAPE_SPKI"
src/crypto/netscape_spki.h:24: warning: no semicolon at end of struct or 
union
src/crypto/netscape_spki.h:26: error: syntax error before '}' token
src/crypto/netscape_spki.h:26: warning: type defaults to `int' in 
declaration of
 `crypto_NetscapeSPKIObj'
src/crypto/netscape_spki.h:26: warning: data definition has no type or 
storage c
lass
In file included from src/crypto/crypto.h:20,
                 from src/crypto/crypto.c:13:
src/crypto/x509store.h:25: error: syntax error before "X509_STORE"
src/crypto/x509store.h:25: warning: no semicolon at end of struct or union
src/crypto/x509store.h:27: error: syntax error before '}' token
src/crypto/x509store.h:27: warning: type defaults to `int' in 
declaration of `cr
ypto_X509StoreObj'
src/crypto/x509store.h:27: warning: data definition has no type or 
storage class

In file included from src/crypto/crypto.h:21,
                 from src/crypto/crypto.c:13:
src/crypto/x509req.h:25: error: syntax error before "X509_REQ"
src/crypto/x509req.h:25: warning: no semicolon at end of struct or union
src/crypto/x509req.h:27: error: syntax error before '}' token
src/crypto/x509req.h:27: warning: type defaults to `int' in declaration 
of `cryp
to_X509ReqObj'
src/crypto/x509req.h:27: warning: data definition has no type or storage 
class
In file included from src/crypto/crypto.h:22,
                 from src/crypto/crypto.c:13:
src/crypto/pkey.h:22: error: syntax error before "EVP_PKEY"
src/crypto/pkey.h:22: warning: no semicolon at end of struct or union
src/crypto/pkey.h:24: error: syntax error before '}' token
src/crypto/pkey.h:24: warning: type defaults to `int' in declaration of 
`crypto_
PKeyObj'
src/crypto/pkey.h:24: warning: data definition has no type or storage class
In file included from src/crypto/crypto.h:23,
                 from src/crypto/crypto.c:13:
src/crypto/x509ext.h:16:28: openssl/x509v3.h: No such file or directory
In file included from src/crypto/crypto.h:23,
                 from src/crypto/crypto.c:13:
src/crypto/x509ext.h:27: error: syntax error before "X509_EXTENSION"
src/crypto/x509ext.h:27: warning: no semicolon at end of struct or union
src/crypto/x509ext.h:29: error: syntax error before '}' token
src/crypto/x509ext.h:29: warning: type defaults to `int' in declaration 
of `cryp
to_X509ExtensionObj'
src/crypto/x509ext.h:29: warning: data definition has no type or storage 
class
In file included from src/crypto/crypto.h:24,
                 from src/crypto/crypto.c:13:
src/crypto/pkcs7.h:15:27: openssl/pkcs7.h: No such file or directory
In file included from src/crypto/crypto.h:24,
                 from src/crypto/crypto.c:13:
src/crypto/pkcs7.h:25: error: syntax error before "PKCS7"
src/crypto/pkcs7.h:25: warning: no semicolon at end of struct or union
src/crypto/pkcs7.h:27: error: syntax error before '}' token
src/crypto/pkcs7.h:27: warning: type defaults to `int' in declaration of 
`crypto
_PKCS7Obj'
src/crypto/pkcs7.h:27: warning: data definition has no type or storage class
In file included from src/crypto/crypto.h:25,
                 from src/crypto/crypto.c:13:
src/crypto/pkcs12.h:14:28: openssl/pkcs12.h: No such file or directory
src/crypto/pkcs12.h:15:26: openssl/asn1.h: No such file or directory
In file included from src/crypto/crypto.h:26,
                 from src/crypto/crypto.c:13:
src/crypto/../util.h:17:25: openssl/err.h: No such file or directory
In file included from src/crypto/crypto.c:13:
src/crypto/crypto.h:75: error: syntax error before '*' token
src/crypto/crypto.h:75: error: syntax error before '*' token
src/crypto/crypto.h:75: warning: type defaults to `int' in declaration 
of `crypt
o_X509_New'
src/crypto/crypto.h:75: warning: data definition has no type or storage 
class
src/crypto/crypto.h:76: error: syntax error before '*' token
src/crypto/crypto.h:76: error: syntax error before '*' token
src/crypto/crypto.h:76: warning: type defaults to `int' in declaration 
of `crypt
o_X509Name_New'
src/crypto/crypto.h:76: warning: data definition has no type or storage 
class
src/crypto/crypto.h:77: error: syntax error before '*' token
src/crypto/crypto.h:77: error: syntax error before '*' token
src/crypto/crypto.h:77: warning: type defaults to `int' in declaration 
of `crypt
o_X509Req_New'
src/crypto/crypto.h:77: warning: data definition has no type or storage 
class
src/crypto/crypto.h:78: error: syntax error before '*' token
src/crypto/crypto.h:78: error: syntax error before '*' token
src/crypto/crypto.h:78: warning: type defaults to `int' in declaration 
of `crypt
o_X509Store_New'
src/crypto/crypto.h:78: warning: data definition has no type or storage 
class
src/crypto/crypto.h:79: error: syntax error before '*' token
src/crypto/crypto.h:79: error: syntax error before '*' token
src/crypto/crypto.h:79: warning: type defaults to `int' in declaration 
of `crypt
o_PKey_New'
src/crypto/crypto.h:79: warning: data definition has no type or storage 
class
src/crypto/crypto.h:80: error: syntax error before '*' token
src/crypto/crypto.h:80: warning: type defaults to `int' in declaration 
of `crypt
o_X509Extension_New'
src/crypto/crypto.h:80: warning: data definition has no type or storage 
class
src/crypto/crypto.h:81: error: syntax error before '*' token
src/crypto/crypto.h:81: error: syntax error before '*' token
src/crypto/crypto.h:81: warning: type defaults to `int' in declaration 
of `crypt
o_PKCS7_New'
src/crypto/crypto.h:81: warning: data definition has no type or storage 
class
src/crypto/crypto.h:82: error: syntax error before '*' token
src/crypto/crypto.h:82: error: syntax error before '*' token
src/crypto/crypto.h:82: warning: type defaults to `int' in declaration 
of `crypt
o_NetscapeSPKI_New'
src/crypto/crypto.h:82: warning: data definition has no type or storage 
class
src/crypto/crypto.c: In function `crypto_load_privatekey':
src/crypto/crypto.c:66: error: `EVP_PKEY' undeclared (first use in this 
function
)
src/crypto/crypto.c:66: error: (Each undeclared identifier is reported 
only once

src/crypto/crypto.c:66: error: for each function it appears in.)
src/crypto/crypto.c:66: error: syntax error before ',' token
src/crypto/crypto.c:70: error: `pem_password_cb' undeclared (first use 
in this f
unction)
src/crypto/crypto.c:70: error: `cb' undeclared (first use in this function)
src/crypto/crypto.c:72: error: `BIO' undeclared (first use in this function)
src/crypto/crypto.c:72: error: `bio' undeclared (first use in this function)
src/crypto/crypto.c:73: error: `pkey' undeclared (first use in this 
function)
src/crypto/crypto.c:97: warning: implicit declaration of function 
`BIO_new_mem_b
uf'
src/crypto/crypto.c:100: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:101: warning: implicit declaration of function 
`PEM_read_bio
_PrivateKey'
src/crypto/crypto.c:104: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:105: warning: implicit declaration of function 
`d2i_PrivateK
ey_bio'
src/crypto/crypto.c:110: warning: implicit declaration of function 
`BIO_free'
src/crypto/crypto.c: In function `crypto_dump_privatekey':
src/crypto/crypto.c:146: error: syntax error before '*' token
src/crypto/crypto.c:148: error: `pem_password_cb' undeclared (first use 
in this
function)
src/crypto/crypto.c:148: error: `cb' undeclared (first use in this function)
src/crypto/crypto.c:150: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:150: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:151: error: `pkey' undeclared (first use in this 
function)
src/crypto/crypto.c:164: error: `cipher' undeclared (first use in this 
function)

src/crypto/crypto.c:164: warning: implicit declaration of function 
`EVP_get_ciph
erbyname'
src/crypto/crypto.c:187: warning: implicit declaration of function `BIO_new'
src/crypto/crypto.c:187: warning: implicit declaration of function 
`BIO_s_mem'
src/crypto/crypto.c:190: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:191: warning: implicit declaration of function 
`PEM_write_bi
o_PrivateKey'
src/crypto/crypto.c:199: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:200: warning: implicit declaration of function 
`i2d_PrivateK
ey_bio'
src/crypto/crypto.c:216: warning: implicit declaration of function 
`BIO_get_mem_
data'
src/crypto/crypto.c: In function `crypto_load_certificate':
src/crypto/crypto.c:236: error: `X509' undeclared (first use in this 
function)
src/crypto/crypto.c:236: error: syntax error before ',' token
src/crypto/crypto.c:239: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:239: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:240: error: `cert' undeclared (first use in this 
function)
src/crypto/crypto.c:248: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:249: warning: implicit declaration of function 
`PEM_read_bio
_X509'
src/crypto/crypto.c:252: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:253: warning: implicit declaration of function 
`d2i_X509_bio
'
src/crypto/crypto.c: In function `crypto_dump_certificate':
src/crypto/crypto.c:288: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:288: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:289: error: `cert' undeclared (first use in this 
function)
src/crypto/crypto.c:298: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:299: warning: implicit declaration of function 
`PEM_write_bi
o_X509'
src/crypto/crypto.c:302: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:303: warning: implicit declaration of function 
`i2d_X509_bio
'
src/crypto/crypto.c: In function `crypto_load_certificate_request':
src/crypto/crypto.c:339: error: `X509_REQ' undeclared (first use in this 
functio
n)
src/crypto/crypto.c:339: error: syntax error before ',' token
src/crypto/crypto.c:342: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:342: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:343: error: `req' undeclared (first use in this 
function)
src/crypto/crypto.c:351: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:352: warning: implicit declaration of function 
`PEM_read_bio
_X509_REQ'
src/crypto/crypto.c:355: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:356: warning: implicit declaration of function 
`d2i_X509_REQ
_bio'
src/crypto/crypto.c: In function `crypto_dump_certificate_request':
src/crypto/crypto.c:391: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:391: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:392: error: `req' undeclared (first use in this 
function)
src/crypto/crypto.c:401: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:402: warning: implicit declaration of function 
`PEM_write_bi
o_X509_REQ'
src/crypto/crypto.c:405: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:406: warning: implicit declaration of function 
`i2d_X509_REQ
_bio'
src/crypto/crypto.c: In function `crypto_load_pkcs7_data':
src/crypto/crypto.c:444: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:444: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:445: error: `PKCS7' undeclared (first use in this 
function)
src/crypto/crypto.c:445: error: `pkcs7' undeclared (first use in this 
function)
src/crypto/crypto.c:456: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:457: warning: implicit declaration of function 
`PEM_read_bio
_PKCS7'
src/crypto/crypto.c:460: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:461: warning: implicit declaration of function 
`d2i_PKCS7_bi
o'
src/crypto/crypto.c: In function `crypto_load_pkcs12':
src/crypto/crypto.c:496: error: syntax error before '*' token
src/crypto/crypto.c:499: error: `BIO' undeclared (first use in this 
function)
src/crypto/crypto.c:499: error: `bio' undeclared (first use in this 
function)
src/crypto/crypto.c:500: error: `PKCS12' undeclared (first use in this 
function)

src/crypto/crypto.c:500: error: `p12' undeclared (first use in this 
function)
src/crypto/crypto.c:506: warning: implicit declaration of function 
`d2i_PKCS12_b
io'
src/crypto/crypto.c: In function `crypto_X509':
src/crypto/crypto.c:533: warning: implicit declaration of function 
`X509_new'
src/crypto/crypto.c: In function `crypto_X509Name':
src/crypto/crypto.c:549: error: `name' undeclared (first use in this 
function)
src/crypto/crypto.c:554: warning: implicit declaration of function 
`X509_NAME_du
p'
src/crypto/crypto.c: In function `crypto_X509Req':
src/crypto/crypto.c:572: warning: implicit declaration of function 
`X509_REQ_new
'
src/crypto/crypto.c: In function `crypto_PKey':
src/crypto/crypto.c:590: warning: implicit declaration of function 
`EVP_PKEY_new
'
src/crypto/crypto.c: In function `crypto_NetscapeSPKI':
src/crypto/crypto.c:633: error: `NETSCAPE_SPKI' undeclared (first use in 
this fu
nction)
src/crypto/crypto.c:633: error: `spki' undeclared (first use in this 
function)
src/crypto/crypto.c:639: warning: implicit declaration of function 
`NETSCAPE_SPK
I_b64_decode'
src/crypto/crypto.c:641: warning: implicit declaration of function 
`NETSCAPE_SPK
I_new'
src/crypto/crypto.c: In function `initcrypto':
src/crypto/crypto.c:684: warning: implicit declaration of function 
`ERR_load_cry
pto_strings'
src/crypto/crypto.c:685: warning: implicit declaration of function 
`OpenSSL_add_
all_algorithms'
src/crypto/crypto.c:709: error: `X509_FILETYPE_PEM' undeclared (first 
use in thi
s function)
src/crypto/crypto.c:710: error: `X509_FILETYPE_ASN1' undeclared (first 
use in th
is function)
src/crypto/crypto.c:712: error: `EVP_PKEY_RSA' undeclared (first use in 
this fun
ction)
src/crypto/crypto.c:713: error: `EVP_PKEY_DSA' undeclared (first use in 
this fun
ction)
src/crypto/crypto.c: At top level:
src/crypto/crypto.c:20: warning: 'CVSid' defined but not used
error: command 'gcc' failed with exit status 1

Many Thanks

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml





More information about the pyopenssl-users mailing list