We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi all,
On Mac OS X with Perl 5.22.0, I have found that Inline::CPP fails to parse virtual string methods.
use warnings; use strict; use Inline 'CPP'; my $plane = new Airplane; my $return = $plane->nonprint(); print $return . "\n"; __END__ __CPP__ #include <sstream> using namespace std; /* Abstract class (interface) */ class Object { public: virtual string nonprint() { ostringstream oretval; oretval << "Object (" << this << ")"; string retval = oretval.str(); return retval; } }; class Airplane : public Object { public: Airplane() {} ~Airplane() {} };
results in the following error:
$ perl inlinecppdebug.pl Can't locate object method "nonprint" via package "Airplane" at inlinecppdebug.pl line 6.
However the C++ itself compiles and behaves as expected:
#include <iostream> #include <sstream> using namespace std; /* Abstract class (interface) */ class Object { public: virtual string nonprint() { ostringstream oretval; oretval << "Object (" << this << ")"; string retval = oretval.str(); return retval; } }; class Airplane : public Object { public: Airplane() {} ~Airplane() {} }; int main(void) { Airplane ap; string val = ap.nonprint(); cout << val; return 0; }
This returns:
$ ./main Object (0x7fff5ebd75e0)
The text was updated successfully, but these errors were encountered:
@daoswald If a solution to this issue can be found, then it will likely help us solve a bug affecting RPerl in Macintosh: wbraswell/rperl#34
But either way I need to know... Is it possible for I::CPP to support virtual string methods? Thanks!
Sorry, something went wrong.
5dd21b2
Yes, but you need to define a typemap. See updated docs.
show how to use typemaps - fix #36
2860272
a569dbc
No branches or pull requests
Hi all,
On Mac OS X with Perl 5.22.0, I have found that Inline::CPP fails to parse virtual string methods.
results in the following error:
However the C++ itself compiles and behaves as expected:
This returns:
The text was updated successfully, but these errors were encountered: