in reply to Calling a function form an external DLL with Inline::C on windows
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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling a function form an external DLL with Inline::C on windows
by Anonymous Monk on Aug 06, 2010 at 11:46 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2010 at 12:21 UTC | |
by Anonymous Monk on Aug 06, 2010 at 12:58 UTC | |
by Anonymous Monk on Aug 06, 2010 at 14:20 UTC | |
by proceng (Scribe) on Aug 09, 2010 at 17:00 UTC | |
| |
by syphilis (Archbishop) on Aug 06, 2010 at 12:50 UTC |