On 2005-03-11, at 10:42:29 -0600, Billy Patton wrote: > Here is my xs: > MODULE = Laff PACKAGE = Laff::Node PREFIX=Node > > Laff::Node > New(class,...) > char* class > CODE: > { > /* search node new */ > int ltype,npts,i,type,config,token; > char *name,buf[256]; > xy_t pts[10000]; > int iary[1000]; > AV* av; > node_p retp; > > > Here is the Laff.c near the approiate line : > XS(XS_Laff__Node_New); /* prototype to pass -Wmissing-prototypes */ > XS(XS_Laff__Node_New) > { > dXSARGS; > if (items < 1) > Perl_croak(aTHX_ "Usage: Laff::Node::New(class, ...)"); > { > char* class = (char *)SvPV_nolen(ST(0)); <<<<<<<<< line # 2457 > Laff__Node RETVAL; > #line 832 "Laff.xs" > { > /* search node new */ > int ltype,npts,i,type,config,token; > > > Here is the error message: > > Laff.c: In function `void XS_Laff__Node_New(PerlInterpreter*, CV*)': > Laff.c:2457: syntax error before `(' token > make: *** [Laff.o] Error 1 > > > Using perl 5.8.0 on Linux and Solaris. > Could it be the C++ mixed with the ... ???
Nope, it has nothing to do with '...' (this is completely valid in C++). The problem is that you're using the C++ keyword 'class' as an identifier. Just replace the 'class' with any other name that's not a C++ keyword and you should be fine. Marcus -- There are three ways to get something done: (1) Do it yourself. (2) Hire someone to do it for you. (3) Forbid your kids to do it.