C++ example in perldoc perlxs

Discussion in 'Perl Misc' started by Torsten Mohr, Oct 7, 2003.

  1. Torsten Mohr

    Torsten Mohr Guest

    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__
     
    Torsten Mohr, Oct 7, 2003
    #1
    1. Advertising

  2. Torsten Mohr

    Owen Guest

    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
     
    Owen, Oct 9, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    27
    Views:
    833
    Marc 'BlackJack' Rintsch
    Mar 17, 2006
  2. James Edward Gray II

    Perldoc Equivalent?

    James Edward Gray II, Aug 28, 2004, in forum: Ruby
    Replies:
    19
    Views:
    361
    Mauricio Fernández
    Sep 6, 2004
  3. Derek Smith

    ri and rdoc....like perldoc?

    Derek Smith, Jul 7, 2010, in forum: Ruby
    Replies:
    7
    Views:
    175
    Roger Pack
    Jul 9, 2010
  4. Thomas

    Need help with perlxs and C strings

    Thomas, Aug 6, 2008, in forum: Perl Misc
    Replies:
    12
    Views:
    201
    Thomas
    Aug 11, 2008
  5. Dilbert
    Replies:
    3
    Views:
    139
    Dilbert
    May 15, 2010
Loading...

Share This Page