Hello all.
I have a problem here and don't seem to find a solution to it.
I have this code in C and a script in Perl that calls a function from the C code.
Now, the thing is that the C function looks something like this:
CalcMap (uword index, const tMainMap * pst_Par)
This tMainMap structure contains 3 elements: x1, x2, x3.
Now, I made an array of three elements to substitute the structure: test_array
and also a function in perl that substitutes the function in C:
test_func(short par0, short test_array)
{
return (CalcMap( par0, ((const tMainMap *)test_array)));
}
Now, in my perl script, I have 3 for loops in which I change the values for the 3 elements of the array and another for loop in which I change the value of the "index" parameter of the C function, and then I call the function:
test_func ($set_index, @test_array);
And here I get a very "nice" error:
Use of inherited AUTOLOAD for non-method main::test_func() is deprecated at D:\test\test_CalcMap.pl line 163.
Can't locate auto/main/test_func.al in @INC (@INC contains: D:\test\_Inline\lib D:/Perl/lib D:/Perl/site/lib .) at D:\test\test_CalcMap.pl line 163
Can anyone help me out with this?!
I have the feeling I cannot pass an array as a parameter to a function but only to subs... am I right?! And if this is actually the problem can somebody tell me another way of getting this solved?!
Thanks in advance!!
darkskin
I have a problem here and don't seem to find a solution to it.
I have this code in C and a script in Perl that calls a function from the C code.
Now, the thing is that the C function looks something like this:
CalcMap (uword index, const tMainMap * pst_Par)
This tMainMap structure contains 3 elements: x1, x2, x3.
Now, I made an array of three elements to substitute the structure: test_array
and also a function in perl that substitutes the function in C:
test_func(short par0, short test_array)
{
return (CalcMap( par0, ((const tMainMap *)test_array)));
}
Now, in my perl script, I have 3 for loops in which I change the values for the 3 elements of the array and another for loop in which I change the value of the "index" parameter of the C function, and then I call the function:
test_func ($set_index, @test_array);
And here I get a very "nice" error:
Use of inherited AUTOLOAD for non-method main::test_func() is deprecated at D:\test\test_CalcMap.pl line 163.
Can't locate auto/main/test_func.al in @INC (@INC contains: D:\test\_Inline\lib D:/Perl/lib D:/Perl/site/lib .) at D:\test\test_CalcMap.pl line 163
Can anyone help me out with this?!
I have the feeling I cannot pass an array as a parameter to a function but only to subs... am I right?! And if this is actually the problem can somebody tell me another way of getting this solved?!
Thanks in advance!!
darkskin