[Ecls-list] UFFI:LOAD-FOREIGN-LIBRARY

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Nov 14 07:34:02 UTC 2005


On Sat, 2005-11-12 at 16:41 +0100, dan at sof.ch wrote:
> Hi,
> 
> I tried to compile my SDL interface with latest CVS version and I got
> a problem with the load-foreign-library.
> 
> The lines:
> 
> (uffi:load-foreign-library "/usr/lib/libSDL.so")
> (uffi:load-foreign-library "/usr/lib/libSDL_image.so")
> 
> cause the compilation process to terminate with the following errors:[...]
> Do I missuse the LOAD-FOREIGN-LIBRARY or is it something wrong with
> the new versions of ffi.lsp ?

The new version is wrong, but it is difficult to come up with a right
version. I have done my best with the following logic

0) If you are using the dynamic FFI (i.e. LOAD-FOREIGN-LIBRARY is
evaluated at the toplevel on an Intel machine), then let the shared
library loader guess what to do.

1) Otherwise, if the argument is a pathname, or the namestring of an
existing file, add the namestring to the list of libraries the code is
linked with.

2) Finally, if it is a string or a symbol, try guessing the name of a
shared (unix) or static (*.lib, windows) library to link the code
against.

Please complain if it does not work as expected :-)

Juanjo





More information about the ecl-devel mailing list