Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > C++ example in perldoc perlxs

Reply
Thread Tools

C++ example in perldoc perlxs

 
 
Torsten Mohr
Guest
Posts: n/a
 
      10-07-2003
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__


 
Reply With Quote
 
 
 
 
Owen
Guest
Posts: n/a
 
      10-08-2003
On Tue, 07 Oct 2003 22:09:52 +0200, Torsten Mohr wrote:

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ri and rdoc....like perldoc? Derek Smith Ruby 7 07-09-2010 03:56 PM
Tutorial question - perldoc perlxs - learning how to write XS-basedcode Dilbert Perl Misc 3 05-15-2010 05:39 PM
Need help with perlxs and C strings Thomas Perl Misc 12 08-11-2008 09:16 AM
Tried Ruby (or, "what Python *really* needs" or "perldoc!") john_sips_tea@yahoo.com Python 27 03-17-2006 10:02 PM
Perldoc Equivalent? James Edward Gray II Ruby 19 09-06-2004 05:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57