jlbprof has asked for the wisdom of the Perl Monks concerning the following question:

I just joined a project that embeds a perl interpreter and exposes a lot of its base functionality to the perl for extensions. The project currently uses KDE and QT3. I am trying to remove the need for KDE so that we can move on to QT4. Loading our dynamic library for perl extensions works perfectly in KDE. I am trying to replace the KDE library loader with the QT loader and have run into some problems that you might be able to shed some light on for me.

When using the QT library loader when our underlying perl script runs I get the following errors.

Can't load '/usr/lib/perl5/5.8.7/i686-linux/auto/IO/IO.so' for module +IO: /usr/lib/perl5/5.8.7/i686-linux/auto/IO/IO.so: undefined symbol: PL_sv +_undef at /usr/lib/perl5/5.8.7/i686-linux/XSLoader.pm line 68. at /usr/lib/perl5/5.8.7/i686-linux/IO.pm line 11 Compilation failed in require at /usr/lib/perl5/5.8.7/i686-linux/IO/Ha +ndle.pm line 260. BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.7/i686-linux/I +O/Handle.pm line 260. Compilation failed in require at /usr/lib/perl5/5.8.7/i686-linux/IO/Se +ekable.pm line 101. BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.7/i686-linux/IO/Seekable.pm line 101. Compilation failed in require at /usr/lib/perl5/5.8.7/i686-linux/IO/Fi +le.pm line 133. BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.7/i686-linux/I +O/File.pm line 133. Compilation failed in require at appdata/perl/battlerecorder.pl line 5 +. BEGIN failed--compilation aborted at appdata/perl/battlerecorder.pl li +ne 5.


The final reference in the dump, battlerecorder.pl starts the interaction with our C++ code. My colleague on this project thinks the problem is because the QTLibrary loader does not expose the global namespace (I am not sure exactly what that means).

Anyway, I am good in Perl itself, but am a little challenged on this problem any information you could provide for me I would appreciate.

Thanx

Julian

Replies are listed 'Best First'.
Re: Perl embedding
by PodMaster (Abbot) on Feb 27, 2006 at 06:07 UTC

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

      I appreciate your response, but this does not fix my problem. Can anyone tell me where PV_sv_undef is suppose to be? I did nm's on all the .so files in the perl lib directory for this version and none of the .so files publish any symbols. Where is PV_sv_undef suppose to be satisfied? Thanx Julian
        Can anyone tell me where PV_sv_undef is suppose to be?
        There is no PV_sv_undef.
        The symbol PL_sv_undef is supposed to be somewhere in libperl.so (although not by that exact name). It wasn't available in 5.004050 or earlier (can be made available through Devel::PPPort to a certain extent). Its defined in various perl include files (perlapi.h, embedvar.h), you (ext/IO) get it by including perl.h/XSUB.h.

        Your problem is that whatever perl is trying to load '/usr/lib/perl5/5.8.7/i686-linux/auto/IO/IO.so' doesn't define PL_sv_undef.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.