cc -c -O -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -Kpic -I/usr/local/lib/
perl5/sun4-solaris/5.00405/CORE myclass.c
"/home/judyf/perlwork/myclass/myclass.h", line 9: undefined or not a type: class
"/home/judyf/perlwork/myclass/myclass.h", line 9: syntax error before or at: col
or
"/home/judyf/perlwork/myclass/myclass.h", line 9: undefined or not a type: color
"/home/judyf/perlwork/myclass/myclass.h", line 15: syntax error before or at: /
"/home/judyf/perlwork/myclass/myclass.h", line 23: syntax error before or at: in
t
"/home/judyf/perlwork/myclass/myclass.h", line 24: cannot recover from previous
errors
cc: acomp failed for myclass.c
*** Error code 2
make: Fatal error: Command failed for target `myclass.o'
####
class color {
public:
color();
~color();
int blue();
int set_blue( int );
private:
int c_blue;
};
####
int
color::blue()
void
color::set_blue( val )
int val
####
MODULE = myclass PACKAGE = myclass
####
color * O_OBJECT
OUTPUT
# The Perl object is blessed into 'CLASS', which should be a
# char* having the name of the package for the blessing.
O_OBJECT
sv_setref_pv( $arg, CLASS, (void*)$var );
INPUT
O_OBJECT
if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
$var = ($type)SvIV((SV*)SvRV( $arg ));
else{
warn( \"${Package}::$func_name() -- $var is not a blessed SV ref
erence\" );
XSRETURN_UNDEF;
}
####
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'myclass',
'VERSION_FROM' => 'myclass.pm', # finds $VERSION
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'XSOPT' => '-C++',
);