I think you've *nearly* nailed it. To make it work you could probably invoke the help of the 'autowrap' config option ... see the Inline::C docs (I'm not really up to speed with this aspect of Inline::C).use strict; use warnings; use Inline C => Config => MYEXTLIB => 'd:\path\to\CrappyLibrary.dll', INC => '-Id:\path\to', BUILD_NOISY => 1; use Inline C => 'DATA'; my $result = RegisterClient2($client_id, $S{read_IP}); __DATA__ __C__ #include "Easy4ApiDef.h"
This should work ok with the gcc compiler (no hope at all with M$ compilers, as they can't link to dll's).use strict; use warnings; use Inline C => Config => MYEXTLIB => 'd:\path\to\CrappyLibrary.dll', INC => '-Id:\path\to', BUILD_NOISY => 1; use Inline C => 'DATA'; my $client_id = 5; #numeric my $read_IP = 'whatever'; #string my $result = wrap_RegisterClient2($client_id, $S{read_IP}); __DATA__ __C__ #include "Easy4ApiDef.h" int wrap_RegisterClient2(int cl_id, char* read_ip) { return RegisterClient2(cl_id, read_ip); }
In reply to Re: Calling a function form an external DLL with Inline::C on windows
by syphilis
in thread Calling a function form an external DLL with Inline::C on windows
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |