[xmlsec] Compiling with MSVC 10: thousands of errors

Josef Kokeš j.kokes at apatykaservis.cz
Tue Jul 12 00:07:48 PDT 2011


Hi!

I could use some help with compiling XmlSec (the latest version 1.2.18) 
on Windows. My original attempts were done using MingW/Msys and these 
failed even before I got to compiling XmlSec (I just couldn't get some 
prerequisites to compile).

With MSVC 10.0, I eventually managed to compile all prerequisites, and 
now I am trying to compile XmlSec itself. The problem is, I keep getting 
thousands of errors in header files:

	cl.exe /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_REENTRANT"  /W1 
/MD /I.. /I..\include /I.\include /D PACKAGE=\"xmlsec\" /D 
"HAVE_STDIO_H" /D "HAVE_STDLIB_H" /D "HAVE_STRING_H" /D "HAVE_CTYPE_H" 
/D "HAVE_MALLOC_H" /D "HAVE_MEMORY_H" /D "_DEBUG" /Od /Z7 
/DXMLSEC_MSCRYPTO_NT4=1 /D "XMLSEC_DL_WIN32" /D "XMLSEC_OPENSSL_098" /D 
"XMLSEC_CRYPTO_OPENSSL" /D "XMLSEC_CRYPTO=\"openssl\"" 
/Folibxmlsec_openssl.int\ /c ..\src\openssl\app.c ..\src\openssl\bn.c 
..\src\openssl\ciphers.c ..\src\openssl\crypto.c 
..\src\openssl\digests.c ..\src\openssl\evp.c ..\src\openssl\hmac.c 
..\src\openssl\kt_rsa.c ..\src\openssl\kw_aes.c ..\src\openssl\kw_des.c 
..\src\openssl\signatures.c ..\src\openssl\symkeys.c 
..\src\openssl\x509.c ..\src\openssl\x509vfy.c
app.c
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(56) : error C2143: 
syntax error : missing ')' before '*'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(56) : error C2081: 
'BIO' : name in formal parameter list illegal
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(56) : error C2143: 
syntax error : missing '{' before '*'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(57) : error C2370: 
'xmlSecKeyDataFormat' : redefinition; different storage class
         C:\xml\xmlsec1-1.2.18\include\xmlsec/keysdata.h(236) : see 
declaration of 'xmlSecKeyDataFormat'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(57) : error C2146: 
syntax error : missing ';' before identifier 'format'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(58) : error C2059: 
syntax error : 'type'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(58) : error C2059: 
syntax error : ')'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(84) : error C2143: 
syntax error : missing ')' before '*'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(84) : error C2143: 
syntax error : missing '{' before '*'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(85) : error C2370: 
'xmlSecKeyDataFormat' : redefinition; different storage class
         C:\xml\xmlsec1-1.2.18\include\xmlsec/keysdata.h(236) : see 
declaration of 'xmlSecKeyDataFormat'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(85) : error C2146: 
syntax error : missing ';' before identifier 'format'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(86) : error C2059: 
syntax error : 'type'
C:\xml\xmlsec1-1.2.18\include\xmlsec/openssl/app.h(88) : error C2059: 
syntax error : ')'

And so on and so on. After 100 errors the compiler stops and tries 
another file, which fails with similar errors (on different lines, 
though). Searching the archives, I found a 2005 message which seemed 
somewhat relevant 
(http://www.mail-archive.com/xmlsec@aleksey.com/msg02730.html) and the 
answer suggested that the user was using a wrong OpenSSL version. That 
is not the case with my setup, as far as I can tell.

I am using a clean Windows XP SP3 install with a clean Microsoft Visual 
Studio 10.0 Express on it. I compiled the following packages (in listed 
order):

- Zlib 1.2.5 - I used the supplied win32\Makefile.msc
- Iconv 1.13 - this one gave me headaches until I learned that I can 
build it using MingW and then copy the .a files to .lib files for MSVC 
to use. Maybe this is the cause of my problems? But what else am I 
supposed to do, considering that Iconv doesn't support MSVC anymore?
- LibXml2 2.7.8 - with configure.js options compiler=msvc zlib=yes debug=yes
- LibXslt 1.1.26 - with configure.js options compiler=msvc zlib=yes 
debug=yes
- OpenSSL 0.9.8r - with configure option VC-WIN32, build batch 
ms\do_masm and makefile ms\ntdll.mak
- XmlSec 1.2.18 - with configure.js options crypto=openssl unicode=no 
debug=yes. I also tried crypto=openssl=098, under the influence of the 
2005 message

What can I possibly do to fix this problem? The files with errors listed 
seem OK to me, but I am not a C programmer so maybe I am missing 
something obvious.

Thanks,

Pepak


More information about the xmlsec mailing list