Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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?

Comment on XS cannot properly handle typemap with namespace
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1069080]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-20 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls