No such thing as a small change | |
PerlMonks |
Re: how use the Inline::CPP module with a custom libraryby syphilis (Archbishop) |
on Aug 03, 2006 at 11:34 UTC ( [id://565421]=note: print w/replies, xml ) | Need Help?? |
You can't just access the functions in ae_util.so as simply as that. Normally you would write an Inline::CPP function that accesses (or just wraps) the ae_util.so function - and you would call that accessor/wrapper function from your perl code. In 'perldoc Inline::C-Cookbook' you'll find a simple example that achieves this wrt a Win32 dll (which is the Win32 equivalent of a '.so'). Look for the string 'Just Desserts' (minus the quotes) in that documentation. The aim of that exercise is to call user32.dll's MessageBoxA() function - which is wrapped by the Winbox() function. You can see that it's the WinBox() function that gets called from perl, not the MessageBoxA() function. If you go back up through that documentation you'll find a section headed 'Automatic Function Wrappers' which mentions Inline::C's 'autowrap' capability. That capability may also extend to Inline::CPP ... I don't know - I've not even used it in an Inline::C environment. In fact it wouldn't hurt to have a good look right through the Inline::C Cookbook, as there's likely other useful stuff there for you. Sorry - I don't have anything specific to Inline::CPP. I'm not very familiar with either it or C++. Peruse its documentation (there's lots of examples and other info in 'perldoc Inline::CPP') and the test scripts that came with the source - you may well find something helpful there. Also, if you want to call the 'new' method, I expect you'll have to provide that method. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|