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'
The code in the prop.c where the error is looks XS(XS_Win32__File__Prop_ReadProperty) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Win32::File::Prop::ReadProperty(THIS)"); { Properties * THIS; // This generates the error int RETVAL; dXSTARG;
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) THIS = (Properties *)SvIV((SV*)SvRV( ST(0) )); //and here also (line above) else{ warn( "Win32::File::Prop::ReadProperty() -- THIS is not a blessed SV reference" ); XSRETURN_UNDEF; };
RETVAL = THIS->ReadProperty(); // and here XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
It seems to me that the the class Properties which I defined can not be used. Please can someone help me?
I tryed to complie the Ex7 sample of CookBookA from Dean Roehrich and that worked.
Thank you, Reinhard