Access a c++ module from Perl

Access a c++ module from Perl

am 24.10.2005 17:21:59 von bg-greece

I am using cygwin and perl and trying to access some function from a C++
windows dll. After the first attempt produced a segmentation fault, I tried
to do it step-by-step. I created a dummy function in the dll file:

int TestDLL(int x)
{
return 1;
}


and put the following code in a perl file:

use strict;
use Win32::API::Prototype;

my $TestDLL = ApiLink("mydll",'I TestDLL(I x)');
if (not defined $TestDLL) {
die "Can't import API TestDLL: $! \n";
}
print "ApiLink done\n";

my $xx = 0;
my $return = $TestDLL->Call($xx);
print $return."\n";


But even this produces a segmentation fault (core dump). Any ideas?

BG