Hey monks, I'm working on a Lua-Perl bridge, and I've hit a snag on the way. Basically, I'm writing a dynamically-loadable module for Lua that allows Lua to evaluate Perl expressions (later on, I hope for it to be able to exchange data between the two environments seamlessly). Things work fine until I evaluate something like use Scalar::Util, which results in the following error (I'm on Fedora 12, 64-bit):
Can't load '/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi/auto/B/B +.so' for module B: /usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi/auto/B/B.so: undefin +ed symbol: PL_opargs at /usr/lib64/perl5/5.10.0/x86_64-linux-thread-m +ulti/XSLoader.pm line 64. at /usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi/B.pm line 316
I checked out the "Using Perl modules, which themselves use C libraries, from your C program" section of perlembed, but it didn't have much to say on this kind of error. However, if I build a custom Lua interpreter with my module statically linked into it, use Scalar::Util works without a problem. I understand the basics of linking, but when a dlopen'd module is linked to a shared object that dlopens other modules...that's when I get confused.
In the interest of getting a good response, I've created a sample program that replicates this error, sans Lua. The source is available here:
http://hoelzro.net/public/perl-test.tar.gzIf you extract the archive and run make, it'll create two executables: test-static and test-dynamic. Running test-static should just print Scalar::Util's version. Running test-dynamic will print an error message similar to the one above, along with Scalar::Util's version.
I would appreciate any and all help you would be able to give me!
Thanks,In reply to Perl embedding woes: undefined symbols by robhoelz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |