Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?

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?
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-02-22 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (335 votes). Check out past polls.