Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

XS cannot properly handle typemap with namespace

by llancet (Friar)
on Jan 03, 2014 at 04:47 UTC ( #1069080=perlquestion: print w/replies, xml ) Need Help??
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......

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1069080]
Approved by kcott
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-06-22 00:23 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.