Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get started writing Perl bindings for a C++ library?

Tags:

c++

perl

cpan

I want to write Perl bindings for a C++ library, so that the library can be used from Perl. How would I get started doing this? I've written pure-Perl modules for CPAN before.

like image 574
Andreas Avatar asked Oct 25 '11 11:10

Andreas


1 Answers

There is SWIG and there XS. I used XS for Net::Sharktools which was the first time I wrote any XS code. I point to it because it was a particularly trivial case, and might be a good way to get an idea of what is involved.

perldoc perlxs includes a section on C++ specific aspects as well.

like image 78
Sinan Ünür Avatar answered Oct 29 '22 21:10

Sinan Ünür