Reinhard Pagitsch wrote:
Hello,
I try to use C++ code in my perl XS module, but allways I get the following errors from cl:
Prop.c(49) : warning C4518: 'void ' : storage-class or type specifier(s) unexpected here; ignored
Prop.c(49) : error C2059: syntax error : ';'
Prop.c(54) : error C2513: 'void' : no variable declared before '='
Prop.c(60) : error C2062: type 'void' unexpected
Prop.c(72) : warning C4518: 'void ' : storage-class or type specifier(s) unexpected here; ignored
Prop.c(72) : error C2059: syntax error : ';'
Prop.c(75) : error C2513: 'void' : no variable declared before '='
Prop.c(81) : error C2062: type 'void' unexpected
NMAKE : fatal error U1077: 'cl' : return code '0x2'
I found it what the problem causes: For this module I have to include Objidl.h (IStorage class)
If I use #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "windows.h" #include "Objidl.h"
Then I get the following errors/warnings:
d:\Program Files\Microsoft SDK\include\MsXml.h(1926) : warning C4002: too many actual parameters for macro 'PerlProc_abort'
d:\Program Files\Microsoft SDK\include\MsXml.h(1926) : error C2059: syntax error : '('
If I use: #include "windows.h" #include "Objidl.h" #include "EXTERN.h" #include "perl.h" #include "XSUB.h"
Than I get only the errors described in my last message.
Does anyone know how to avoid them?
Thank you, Reinhard