C++ example in perldoc perlxs

T

Torsten Mohr

Hi,

i'd like to compile and install the C++ example mentioned
in "perldoc perlxs". I use perl 5.8 on my Linux system.

I've put the whole test project here:

http://www.s.netic.de/tmohr/cc.tar.gz

I can successfully compile and install the underlying
libAmod.so, that contains code for a C++ class:

class aMod {
private:
int a;

public:
aMod();
~aMod();

int getA(void);
void setA(int v);
};

The XS file i wrote generates C code and contains code and
the perl module installs without errors. But when i call:

#! /usr/bin/perl -w

use aMod;

$a = aMod->new();

Use of inherited AUTOLOAD for non-method aMod::aMod() is deprecated at
./qwe.pl line 5.
Can't locate auto/aMod/aMod.al in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i586-linux-thread-multi /usr/lib/perl5/5.8.0 .....

It seems to me that "aMod" is somehow still unknwon to perl, maybe
due to a wrong startup code in aMod.pm (i've attached it below)?


Has anybody got a hint for me?


Best regards,
Torsten.



--------- aMod.pm:
package aMod;

#use strict;
use warnings;

require Exporter;
require DynaLoader;

our @ISA = qw(Exporter DynaLoader);

our @EXPORT = (
aMod
);

our $VERSION = '0.01';

bootstrap aMod $VERSION;


1;


__END__
 
O

Owen

Can't locate auto/aMod/aMod.al in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i586-linux-thread-multi /usr/lib/perl5/5.8.0 .....

So where did you place the module?

If it is not in @INC, then you need to do something like this

use lib '/where/ever/my/module';
use aMod;



Owen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top