Dear perlfaq-workers,

the following text is a suggestion to add to FAQ.

I recently read PERLXSTUT on
http://www.perldoc.com/perl5.6/pod/perlxstut.html#EXAMPLE-4 which is
extremely useful and helpful. This applies especially to Example 4 which
documents how to extend Perl by building dynamic C-libraries which can be
called out of Perl-Scripts via XS-Interface. What I'm trying to do, is to
build in C++ code into a dynamic library using tools described.

Firstly I made sure that example 4 as given works fine on my computer (
SuSE Linux 8.1 with Perl 5.8.0 )
Then I extended example 4 just by adding a test.cpp and test.h file which
simply define a class Ctestbase.
I extended mylib.c file by including test.h.

Then I used "perl Makefile.PL" to generate a new Makefile and ran make
which lead to parse errors when compiling test.h. They were obviously due
to declaration of class Ctestbase in test.h. My first try to cure this
problem was to change cc to g++ in Makefile. But this only lead to other
problems.

I also read
http://www.perldoc.com/perl5.6/pod/perlxs.html#Using-XS-With-C%2b%2b which
gives me the impression that it does not solve the problem because the code
mentioned there is actually a Perl-representation of OO-techniques but not
a *.CPP-File.

Please help me !  I would appreciate to get a small source code example if
possible.

Thank You very much in advance and best regards

Josef

****************************************
Interflex Datensysteme GmbH & Co KG
Josef Koprek
Grosswiesenstrasse 24
D-78591 Durchhausen
Tel.: 0049 7464-382-333
Fax.:0049 7464-382-597
E-Mail: [EMAIL PROTECTED]
Web:   www.interflex.de
****************************************



Reply via email to