I would appreciate any help on this problem.
I have a class A as defined below which contains a method func that has
a output parameter which is defined as MyFoo**.
The output from this method func is a list of pointers to instances of
int func(const char *x, const char *y, MyFoo **objList);
char * toString();
I ran swig on this header file and then compiled the .cxx to form a
Now I am trying to use this method from a perl script.
This is my perl script code.
$pcc =3D new smi_scripting::A();
$ret2 =3D $pcc->func("user", "user", $pp);
print $pp[i]->toString() ;
I keep getting this runtime error at the line where I am calling
Can't call method "toString" on an undefined value at smi_scripting.pl
What do I need to do, to cast the return value of $pp[i] as a MyFoo *?
Can someone please advice?
Thanks in advance.
From: Jason Stewart <jason.e.stewart@gm...> - 2006-03-03 10:50:07
On 3/3/06, Aparna Vasanth <avasanth@...> wrote:
> Can't call method "toString" on an undefined value at smi_scripting.pl li=
> What do I need to do, to cast the return value of $pp[i] as a MyFoo *?
casting isn't the problem - read the error carefully: $pp[i] is
*undefined* - it is NULL. You can cast a NULL pointer to anything you
want, but I don't think that will help you. You probably want to look
at your code and figure out why you have an undef in your list.
Get latest updates about Open Source Projects, Conferences and News.