in reply to problem finding symbol in XS-created .so

$id3 = Audio::TagLib::FileRef->new( 't.mp3' );

But fileref.xs defines functions (such as new) that are in package "TagLib::FileRef", *not* package "Audio::TagLib::FileRef". What happens if you recode that line to:
$id3 = TagLib::FileRef->new( 't.mp3' );
Cheers,
Rob

Replies are listed 'Best First'.
Re^2: problem finding symbol in XS-created .so
by Anonymous Monk on May 25, 2010 at 15:12 UTC
    It also defines a fix for that
    sub xs_c { my $cmd = shift->SUPER::xs_c(@_); $cmd .= << 'END'; sed -i -e 's/newXSproto("TagLib/newXSproto("Audio::TagLib/g' $*.c sed -i -e 's/XS(boot_TagLib)/XS(boot_Audio__TagLib)/g' $*.c END return $cmd; }
      I'm sory, but I have no idea how this code relates to my problem.
Re^2: problem finding symbol in XS-created .so
by geoffleach (Scribe) on May 25, 2010 at 12:37 UTC
    Can't locate TagLib/FileRef.pm in @INC ...
      No ... you still use Audio::TagLib; (Update: not use Audio::TagLib::FileRef as I had first written) but, instead of $id3 = Audio::TagLib::FileRef->new( 't.mp3' ); you have $id3 = TagLib::FileRef->new( 't.mp3' );
      I don't really know whether that will work - I'd probably rather try changing the package name in fileref.xs to "Audio::TagLib::FileRef", but I don't know whether that will work, either :-)
      The module looks to me like a dog's breakfast

      I'll see if I can get anywhere with it on Windows and get back. In the meantime, just try anything you can think of.

      Cheers,
      Rob
        use Audio::TagLib; $id3 = TagLib::FileRef->new( 't.mp3' ); $artist = $id3->tag()->artist(); Can't locate object method "tag" via package "Audio::TagLib::FileRef" +at ./MP3test.pl
        Thanks for getting me one step further.
        I'll see if I can get anywhere with it on Windows

        Well ... the latest version of the taglib library (1.6.3) builds straight out of the box on MS Windows, but look what happens when one attempts to build Audio::TagLib:
        ... ONLY support TagLib version 1.4.* MSWin32 is not supported currently at Makefile.PL line 11 main::BEGIN() called at Makefile.PL line 22 eval {...} called at Makefile.PL line 22 ...
        Sorry - lost interest. What version of the taglib library are you using ?

        Cheers,
        Rob