How to extend an XS extension? (Inline::C?)

Discussion in 'Perl Misc' started by kj, Aug 16, 2005.

  1. kj

    kj Guest

    One of the modules I use is a (huge) XS extension (say Foo.pm).
    Unfortunately, this module is missing some functions that I need,
    and that, for performance reasons, I need to code in C. These
    functions are quite simple, so I thought I'd do this with Inline::C.
    Unfortunately, I'm not getting very far.

    I use the following in my code:

    use Inline C => Config =>
    INC => '-I/path/to/header/files',
    LIBS => '-L/path/to/arch/auto/Foo -lFoo',
    TYPEMAPS => '/path/to/Foo/typemap';

    use Inline C => <<'EOCODE';

    /* my C code */

    EOCODE

    Still the compiler complains that it cannot find certain functions
    that are required by Foo's typemap file. These functions are
    defined in the library Foo.so, which resides in /path/to/arch/auto/Foo,
    but, despite the code above, the compiler compains of not being
    able to find it. What am I doing wrong?

    Thanks!

    kj

    --
    NOTE: In my address everything before the first period is backwards;
    and the last period, and everything after it, should be discarded.
     
    kj, Aug 16, 2005
    #1
    1. Advertising

  2. kj

    Sisyphus Guest

    "kj" <> wrote in message

    [snip]

    >
    > I use the following in my code:
    >
    > use Inline C => Config =>
    > INC => '-I/path/to/header/files',
    > LIBS => '-L/path/to/arch/auto/Foo -lFoo',


    Not sure about this, but if you're trying to link to Foo.dll, then I think
    you need to do it with MYEXTLIB instead of LIBS - something like:

    MYEXTLIB => '/path/to/arch/auto/Foo/Foo.dll',

    Let us know if that doesn't solve the problem.

    I've not had need to use Inline C to access a perl dll .... and I'm
    struggling to make sense of the need for it ... but that might just be a
    result of my brain being somewhat inflexible :)

    Cheers,
    Rob
     
    Sisyphus, Aug 16, 2005
    #2
    1. Advertising

  3. kj

    Sisyphus Guest

    "Sisyphus" <> wrote in message
    news:43014c9f$0$22557$...
    >
    > "kj" <> wrote in message
    >
    > [snip]
    >
    > >
    > > I use the following in my code:
    > >
    > > use Inline C => Config =>
    > > INC => '-I/path/to/header/files',
    > > LIBS => '-L/path/to/arch/auto/Foo -lFoo',

    >
    > Not sure about this, but if you're trying to link to Foo.dll, then I think


    Ooops - your shared object is an 'so' not a 'dll', so s/dll/so/g .

    > you need to do it with MYEXTLIB instead of LIBS - something like:
    >
    > MYEXTLIB => '/path/to/arch/auto/Foo/Foo.dll',
    >
    > Let us know if that doesn't solve the problem.
    >
    > I've not had need to use Inline C to access a perl dll .... and I'm
    > struggling to make sense of the need for it ... but that might just be a
    > result of my brain being somewhat inflexible :)
    >


    Also check perldoc Inline::C-Cookbook and look for the section "Event
    handling with Event.pm". This appears to be similar to what you're trying.

    Cheers,
    Rob
     
    Sisyphus, Aug 16, 2005
    #3
  4. kj

    kj Guest

    In <43014c9f$0$22557$> "Sisyphus" <> writes:


    >"kj" <> wrote in message


    >[snip]


    >>
    >> I use the following in my code:
    >>
    >> use Inline C => Config =>
    >> INC => '-I/path/to/header/files',
    >> LIBS => '-L/path/to/arch/auto/Foo -lFoo',


    >Not sure about this, but if you're trying to link to Foo.dll, then I think
    >you need to do it with MYEXTLIB instead of LIBS - something like:


    That did the trick. Thanks!

    kj

    --
    NOTE: In my address everything before the first period is backwards;
    and the last period, and everything after it, should be discarded.
     
    kj, Aug 16, 2005
    #4
    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. Abhi
    Replies:
    2
    Views:
    764
    E. Robert Tisdale
    Jul 3, 2003
  2. Alvin
    Replies:
    7
    Views:
    508
    E. Robert Tisdale
    May 6, 2005
  3. Replies:
    3
    Views:
    490
  4. Daniel Vallstrom
    Replies:
    2
    Views:
    2,040
    Kevin Bracey
    Nov 21, 2003
  5. James Stroud

    extension to list extend

    James Stroud, Oct 16, 2007, in forum: Python
    Replies:
    2
    Views:
    295
    James Stroud
    Oct 16, 2007
Loading...

Share This Page