How to call a function from a shared library ?

Discussion in 'Python' started by Tom Van Acker, May 11, 2004.

  1. Hello,

    I'm getting overwhelmed by information if I google this question. But
    it is not clear to me. I have a shared library (.so file), created by
    some other company we work with. Now I have to call a certain function
    from this shared library. The declaration looks like this;

    int TransformPoints(void * vel_g, void* vel_i, void* vpoints, int nb)
    ;

    Untill now, I was using the ctypes module to access this function. The
    first two parameters are arrays[0..23] of type double and the third
    parameter is an array[0..2] of type double. Using the ctypes module,
    this works allright.

    But now I have to port this application to other platforms, and I
    cannot use the ctypes module anymore (due to libffi incompatibility).
    Is there another way to do this?

    Any help would be greatly appreciated.

    Tom
     
    Tom Van Acker, May 11, 2004
    #1
    1. Advertisements

  2. Tom Van Acker

    Nigel Rowe Guest

    Tom Van Acker wrote:

    > Hello,
    >
    > I'm getting overwhelmed by information if I google this question. But
    > it is not clear to me. I have a shared library (.so file), created by
    > some other company we work with. Now I have to call a certain function
    > from this shared library. The declaration looks like this;
    >
    > int TransformPoints(void * vel_g, void* vel_i, void* vpoints, int nb)
    > ;
    >
    > Untill now, I was using the ctypes module to access this function. The
    > first two parameters are arrays[0..23] of type double and the third
    > parameter is an array[0..2] of type double. Using the ctypes module,
    > this works allright.
    >
    > But now I have to port this application to other platforms, and I
    > cannot use the ctypes module anymore (due to libffi incompatibility).
    > Is there another way to do this?
    >
    > Any help would be greatly appreciated.
    >
    > Tom


    Maybe Pyrex (http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/).
    --
    Nigel Rowe
    A pox upon the spammers that make me write my address like..
    rho (snail) swiftdsl (stop) com (stop) au
     
    Nigel Rowe, May 11, 2004
    #2
    1. Advertisements

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. komal
    Replies:
    6
    Views:
    1,705
    msalters
    Jan 25, 2005
  2. grbgooglefan
    Replies:
    2
    Views:
    647
    Pascal Bourguignon
    Jan 30, 2008
  3. grbgooglefan
    Replies:
    4
    Views:
    672
    Kenny McCormack
    Jan 30, 2008
  4. grbgooglefan
    Replies:
    0
    Views:
    571
    grbgooglefan
    Jan 30, 2008
  5. Replies:
    1
    Views:
    1,512
    santosh
    Jul 15, 2008
  6. Alok
    Replies:
    3
    Views:
    503
  7. THAKUR PRASHANT SINGH

    Class Function call vs Normal Function call

    THAKUR PRASHANT SINGH, Feb 26, 2010, in forum: Ruby
    Replies:
    7
    Views:
    476
    THAKUR PRASHANT SINGH
    Feb 27, 2010
  8. DJ Stunks
    Replies:
    0
    Views:
    479
    DJ Stunks
    Feb 10, 2007
Loading...