Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Embed Perl in C++ (C in perl in C)

by chrestomanci (Priest)
on Jul 26, 2011 at 08:51 UTC ( [id://916712]=note: print w/replies, xml ) Need Help??


in reply to Embed Perl in C++ (C in perl in C)

As the error message said, perl is trying to dynamically load IO.so at runtime and it can't, most likely because of the way you built perl into your C++ application.

If you can't adjust the linker options for your C++ application so that it (and the embedded perl) supports loading on dynamic modules, then your alternative is to adjust your Makefile to statically include the IO related library into your application. You might find that when IO::Socket was installed it built IO.o as well as IO.so, which you can directly link in. If not you will need to include the IO::Socket source tree into your tree, and modify the makefile to build a statically linkable library. This approach will only work if you know in advance which binary modules your script needs. Also if you statically link IO::Socket into your application and distribute it, you will need to respect the licence (same as perl) of IO::Socket, and any conditions it imposes on your entire application.

A third option would be to not use the IO::Socket module and do your socket programming by hand. All the raw socket functions are documented in perlfunc, though they are rather low level, and convoluted to use.

Also, if you do cross post questions in other forums, please say so, and link to the other forum. We don't mind if you cross post, but when we answer questions we usually read what has been said already, as it is annoying to repeat someone else's answer. If you cross post without telling us then we don't know to read the other forum to see if our answer has already been posted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found