[Ecls-list] load-foreign-library
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Sat Oct 21 20:02:47 UTC 2006
2006/10/21, Rick Taube <taube at uiuc.edu>:
> FIND-FOREIGN-SYMBOL: Could not load foreign symbol "_Pm_Initialize"
> from module :DEFAULT (Error: NIL)
Ok, I see where the problem is. CFFI's port for the static FFI is
forced to use the dynamic loader to look for symbols in the library.
However, since we include no explicit references to the functions you
are using, the library is actually not being linked in by gcc.
I think I have a simple fix. Can you edit cffi/src/cffi-ecl.lisp and
change the definition of %load-foreign-library to look as follows?
(defun %load-foreign-library (name)
"Load a foreign library from NAME."
(si:load-foreign-module name))
That should do the work, because at runtime we will ensure that the
library is in memory.
I must say the design of CFFI is giving me headaches. It is really
conceived for the dynamic FFI kind, and it allows things (calling
functions without declaring them, providing your own declarations of
functions without checking them, all pointer types are simple aliases
of void *...) that make a port to the static FFI model of ECL very
difficult.
Regards
Juanjo
More information about the ecl-devel
mailing list