On Sat, 24 Feb 2007 23:36:45 +0800, yong wrote:
> Could somebody tell me how can I call functions that in a dynamic library?
>
> I'm using clisp under linux.
>
> Thanks.
Use CFFI ( http://common-lisp.net/project/cffi/ ) for this:
cl-user> (asdf:operate 'asdf:load-op :cffi)
First load a library (libm contains functions common math stuff):
cl-user> (cffi:load-foreign-library "/usr/lib/libm.so")
Then you can call functions in it. For instance:
cl-user> (cffi:foreign-funcall "cos" :double pi :double)
-1.0d0
--
Lars Rune Nøstdal
http://nostdal.org/
Lars Rune Nøstdal wrote:
> On Sat, 24 Feb 2007 23:36:45 +0800, yong wrote:
>
>> Could somebody tell me how can I call functions that in a dynamic library?
>>
>> I'm using clisp under linux.
>>
>> Thanks.
>
>
> Use CFFI ( http://common-lisp.net/project/cffi/ ) for this:
>
> cl-user> (asdf:operate 'asdf:load-op :cffi)
>
>
> First load a library (libm contains functions common math stuff):
>
> cl-user> (cffi:load-foreign-library "/usr/lib/libm.so")
>
>
> Then you can call functions in it. For instance:
>
> cl-user> (cffi:foreign-funcall "cos" :double pi :double)
> -1.0d0
>
Thanks a lot :)