Luís Oliveira wrote:
On 2006-jan-06, at 10:48, Yaroslav Kavenchuk wrote:
Use CFFI with Windows without cpecification of library is problematic :(
Try (cffi:load-foreign-library "msvcrt.dll") before trying to call sprintf or something standard C function. That should work.
[1]> (asdf:operate 'asdf:load-op 'cffi) ... NIL [2]> (cffi:load-foreign-library "msvcrt.dll") #<FOREIGN-POINTER #x78000000> [3]> (in-package :cffi) #<PACKAGE CFFI> CFFI[4]> (with-foreign-pointer-as-string (s 100) (setf (mem-ref s :char) 0) (foreign-funcall "sprintf" :pointer s :string "%.2f" :double (coerce pi 'double-float) :void)) "4{Ъ↓сЭI"
:(