in reply to Re^2: embedding perl in a shared library crashes if shared lib is loaded dynamically
in thread embedding perl in a shared library crashes if shared lib is load dynamically

When I said "works for me" I meant that RTLD_LAZY worked, unfortnately I'm not currently in a position to try your code (maybe tonight). Sorry to have mis-lead you.

This is pure speculation. The difference with a use statement is that it is executed at compile-time. Could you change the use and require the module after you dynamically loaded your code?

I also found this Problem with dlopen and shared objects using perl libs, but I don't think it helps much.
  • Comment on Re^3: embedding perl in a shared library crashes if shared lib is loaded dynamically

Replies are listed 'Best First'.
Re^4: embedding perl in a shared library crashes if shared lib is loaded dynamically
by lorius (Novice) on Jan 06, 2010 at 16:14 UTC

    thank you, cdarke ! I already tried to interchange use and require without any success (I really tried a lot of things before). But your link to the dlopen problem invited me to try to combine RTLD_NOW with RTLD_GLOBAL in the dlopen call, and now it works !! you saved my day !

    My fear is that the application in which I want to embed the perl interpreter, misses this option too when loading shared libraries, and unfortunately I have no influence on this (it is a commercial predilivered one). But at least I know where to look and check further (reading about compiling and linking... what a pitty, really prefer spending my time with perl itself :-))