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. Advertising

  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. 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. DJ Dev
    Replies:
    3
    Views:
    16,084
    Gandalf
    Feb 8, 2004
  2. Joe Fallon
    Replies:
    3
    Views:
    744
    =?Utf-8?B?Z3V5?=
    Jul 16, 2004
  3. ben
    Replies:
    3
    Views:
    499
    Kevin Spencer
    Nov 15, 2004
  4. Replies:
    1
    Views:
    1,246
    santosh
    Jul 15, 2008
  5. DJ Stunks
    Replies:
    0
    Views:
    311
    DJ Stunks
    Feb 10, 2007
Loading...

Share This Page