Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Extending perl with C dynamic library.

by kennethk (Monsignor)
on Aug 16, 2013 at 20:08 UTC ( #1049778=note: print w/ replies, xml ) Need Help??


in reply to Extending perl with C dynamic library.

You may consider Inline::C rather than DynaLoader for connecting the two. Inline modules compile your external code and then link it automatically via autogenerated XS.

Barring that, you'll want to review the DynaLoader documentation, specially bootstrap() and @dl_require_symbols, which explain why it's looking for boot_test.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Extending perl with C dynamic library.
Download Code
Re^2: Extending perl with C dynamic library.
by Martin90 (Sexton) on Aug 16, 2013 at 22:06 UTC
    Yes I know there is something missing but I don'w know what. What is this "symbol" and how to add this to my .c code ? I have to mention that with XS code compiled to c and then to .so all works. But I want to complie pure c instead of work with XS. So my question is how to add this symbol and how to make it works ?
      What is this "symbol" and how to add this to my .c code ?
      A symbol is just a name for something, a function in this case. It you can't use XS to generate a boot_<module> function for you, you'll have to write it yourself. Not an easy task, but perhaps achievable. Try looking at *.c files generated by xsubpp from *.xs files and writing similar code manually.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-18 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (61 votes), past polls