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

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

I'm trying to write a perl wrapper for my C++ library. My whole library is under a namespace:
namespace geno_eye { typedef int64_t PosType; }
I wrote the following typemap, in which T_IV is a perl build-in typemap:
TYPEMAP geno_eye::PosType T_IV
and I wrote the following XS code:
.... MODULE = GenoEye PACKAGE = GenoEye::Page geno_eye::Page* Page::new(format, file, width, height, genome_display_length) SV* format SV* file double width double height geno_eye::PosType genome_display_length CODE:
It seems xsubpp converts ":" into "_":
GenoEye.c:196:2: error: ‘geno_eye__PosType’ was not declared in this s +cope geno_eye__PosType genome_display_length = (geno_eye__PosType)SvIV(ST +(5))
How to work around it?

Replies are listed 'Best First'.
Re: XS cannot properly handle typemap with namespace (use XSpp)
by Anonymous Monk on Jan 03, 2014 at 04:49 UTC
      It seems XSpp is another system that is completely different with XS. So I'll have to suffer another painful learning......