Use FFI with Linux / Ubuntu ?

bouchet vincent vbouchet at gmail.com
Thu Mar 2 16:39:23 UTC 2006


2006/3/2, Dave Hylands <dhylands at gmail.com>:
>
> Hi Vincent,


Hi Dave

>  I'm  squeak newbie and I want to use a C DLL with FFI on Linux (I use the
> > The Ubuntu Linux distribution).
> >
> >      I have a function test which is written in a Linux C DLL. It works
> when
> > I call it from an exe.
> >  When I call it from my class I obtain the error message : "Error:
> unable to
> > find function address"
>
> Just an off the wall guess, but is the diretory containing test.so
> included in the environment variable LD_LIBRARY_:PATH?


no, I test this and .... same problem, but when I put test.so in my home
directory it's work... thanks, it's the good idea. (I'm really not
accustomed to linux)

> ---------------------------------------------------------------------
> >  TestClass>>testLinux
> >      <cdecl: void 'test' (void) module: 'test.so'>
> >      ^self externalCallFailed
> > ---------------------------------------------------------------------
> >
> >  I use FFI with windows for an C Windows DLL and it works correctly,  so
> is
> > the FFI package works with Linux / Ubuntu ?
>
> I'd be very interested to see your example. I'd like to interface i2c
> to Squeak and to do so I would like to make some wrapper functions
> available (the wrapper functions all eventually call ioctl, but that
> doesn't seem to be availble to Squeak either).


I use "apicall" instead of "cdecl" and just put my dll in the same directory
than squeak.
___________________________________
say: aString
<apicall: long '?play@@YAXPAD at Z' (char *) module:'Acces.dll'>
    ^self externalCallFailed
 ___________________________________

--
> Dave Hylands
> Vancouver, BC, Canada
> http://www.DaveHylands.com/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060302/5bbd9f00/attachment.htm


More information about the Squeak-dev mailing list