<span class="gmail_quote"></span>Greetings!<br>I'm not really sure if this is a CFFI or a CLISP issue, so I'm posting to both ml's.<br><br>I'm trying to make Windows executables images, using Clisp 2.41
(built with readline, iconv and sigsegv). My images have cl projects
loaded, like clsql or celltk. These projects relly on cffi to load
functions from certain dll's (like odbc32.dll). E.g., I load clsql and
save an image.<br><br>There are two problems here:<br>1) Unlike AllegroCL or Lispworks, Clisp (and SBCL too, btw) requires me to precede all defcfuns related to a library with:<br><br>#+clisp (cffi::use-foreign-library Tcl)
<br>(defcfun ("Tcl_FindExecutable" tcl-find-executable) :void<br>  (argv0 :string))<br><br>If I don't do this, I can't apply this function at run-time (I'm not even talking about saved images, yet).
<br>
<br>2) When I load the saved image (using the code from above), I get
an error when applying defcfun'ed functions, telling me the library
wasn't found:<br><font face="Courier, Monospaced"> ** - Continuable Error 
<br> FFI::FOREIGN-CALL-OUT: no dynamic object named "SQLAllocHandle" in <br> library <br>       :DEFAULT </font><br> But then, if I tell clisp where the libraries are, with <br><font face="Courier, Monospaced">

 (cffi:define-foreign-library odbc (t (:default "odbc32"))) <br> (cffi:use-foreign-library odbc) <br></font><br>, I get this:<br><font face="Courier, Monospaced"> *** - FFI::FOREIGN-CALL-OUT: #<INVALID FOREIGN-POINTER #x00000000> 
<br> comes from <br>       a previous Lisp session and is invalid </font><br><br clear="all">The
only workaround I can think of is to make an init-function on my image
that loads all these defcfuns (at run-time), but this is not very sane,
if you are to use many external CL libraries!
<br><br>Thanks for the help,<br>-- <br><span class="sg">Edgar Gonçalves</span><br>