Need help with Perl/C++ interface 
Author Message
 Need help with Perl/C++ interface

I am having a lot of problems trying to get Perl to Call C++ methods
using XS.

Note: I may have posted this yesterday but I can't see it amoung the
postings so apoloigies if its there.

Anyway I have tried both the samples in the XS man page and the panther

Based on the panther book I have created a class car. I have compiled
its method sinto a library file. (tested this though a main. cc it works

Now I have two have two available functions
Car* new_car();
void drive(Car *);

I changed the Makjefile.PL to have 'CC' => 'CC' (cplusuplus instead of
c) and 'LD' => 'CC'. Otherwise the compiler wouldn't recognise the class
type etc.

Then when my car.XS file gets parsed into a "c" file but the syntax is
the old type e.g

void sample (string)
char* string


Which the compiler doesn't like. I am using Solaris compiler 4.2.

Has anyone had similar problems. If not has anyone a simple interface
working so I can see what I'm doing wrong.

Basically I'm stumped so at present my "hacked" solution is to wrap the
C++ in C functions and call them from Perl.


--== Sent via http://www.*-*-*.com/
---Share what you know. Learn what you don't.---

Sat, 27 Oct 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. I need to interface perl/tk with C++

2. Need help: perl api for C++

3. Embedding Perl in C++: Need Help!!!

4. Need help on using Perl as an interactive interface

5. Interfacing Perl with MIME : help needed

6. problems interfacing C++ to Perl via SWIG

7. How to interface perl with C/C++?

8. C++ and Perl Interface

9. Perl Interface to C++

10. Interfacing C++ and Perl

11. C++/perl interface

12. Implementing virtual methods in Perl/C++ interface


Powered by phpBB® Forum Software