http://www.perlmonks.org?node_id=1062338


in reply to Some functions in .xs file can't be found

xs/tag.xs has in it
#include "tag.h" MODULE = Audio::TagLib PACKAGE = Audio::TagLib::Tag PROTOTYPES: ENABLE ################################################################ # # PUBLIC MEMBER FUNCTIONS # ################################################################ void TagLib::Tag::DESTROY() CODE: /* skip if READONLY flag on */ if(!SvREADONLY(SvRV(ST(0)))) delete THIS;
see "PACKAGE = Audio::TagLib::Tag"? That is where the method calls will wind up in. But since this is C++ XS which I'm not familiar with, not C XS, I think the "TagLib::Tag::" get stripped off.

As others said, your header() method in XS exists in a different class than you want it. Check the docs of your C++ library whether the TagLib::Tag class has a header method or not. According to http://taglib.github.io/api/classTagLib_1_1Tag.html it does not.

BTW, you should also mention you are the CPAN maintainer of Audio-TagLib ;)

Replies are listed 'Best First'.
Re^2: Some functions in .xs file can't be found
by geoffleach (Scribe) on Nov 13, 2013 at 23:11 UTC
    OK, you got me. I confess I am the maintainer, alas.

    The good news is that I was shooting myself in the foot by using the wrong abstraction for the file being manipulated. I needed to use Audio::TagLib::MPEG::File rather than Audio::TagLib::FileRef. The latter supports more genereic tag methods, but not the ID3v2 methods, of which header() is one.

    The bad news is that now I have to write more tests. Sigh.

    Thanks to all who replied.